From: Jay Link (jlink@interlink-bbs.com)
Date: Wed 10 May 2000 - 13:43:12 IDT
> I can use the svgalib functions, but not the svgalibgl ones. They link > into my program, but don't do anything. The function that I am suspious > of is: > gl_setcontextvgavirtual(). I'm using G640x480xx16 as the passed > parameter. Is that what I want? I assume the two x's before "16" is a typo. Anyway, what you want is something like this: #include <vga.h> #include <vgagl.h> int main(void) { GraphicsContext *physicalscreen; GraphicsContext *virtualscreen; vga_init(); vga_setmode(G640x480x16); gl_setcontextvga(G640x480x16); physicalscreen = gl_allocatecontext(); gl_getcontext(physicalscreen); gl_setcontextvgavirtual(G640x480x16); virtualscreen = gl_allocatecontext(); gl_getcontext(virtualscreen); ... Then, when you're ready to draw to either the physical or virtual screen, you must tell the program what screen you're interested in by using ONE of the following: gl_setcontext(virtualscreen); -OR- gl_setcontext(physicalscreen); After this, draw as per the usual. To transfer the contents of the virtual screen to the physical screen (or vice-versa), use any of the following: void gl_copyscreen(GraphicsContext * gc); void gl_copyboxtocontext(int x1, int y1, int w, int h, GraphicsContext * gc, int x2, int y2); void gl_copyboxfromcontext(GraphicsContext * gc, int x1, int y1, int w, int h, int x2, int y2); Now, quit being suspicious, and get on with it! :-) -JL
This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST