Mail Archives: djgpp/1996/04/05/07:16:59
>First of all, I understand how to create a graphics context. And I assume
>you draw to it by using set graphics context or whatever. Now how do I
>get this new graphics context to the screen???
If you have a GrContext *MyContext, you draw in it by selecting this context
with :
GrSetContext(MyContext);
Then you come back to the default context (screen) with :
GrSetContext(NULL);
>Basicly I want to know how to do Double Buffering with GRX.
After you draw your image in your MyContext, just Blit it on the screen with
(for example, a 640x300 MyContext on a 640x480 screen) :
GrBitBlt(NULL,0,90,MyContext,0,0,639,299,GrWRITE);
>Second.. Is there anyway to access the memory of the buffer directly so I
>dont have to use the putpixel function everytime?
In the GrContext datas, you have somewhere a gf_baseaddr which is the adress
of the screen. But be aware that you'll have to manage *far* pointers, which
is not obvious with gcc. PutPixel and others libgrx functions are REALLY fast,
Hope it helps.
--
Eric Nicolas <nicolas AT dsys DOT ceng DOT cea DOT fr>
Take a look to the SWORD home page :
http://mimine.iut.univ-metz.fr/~borysgr/sword.web/home.html
- Raw text -