www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/05/07:16:59

Xref: news2.mv.net comp.os.msdos.djgpp:2455
From: nicolas AT dsys DOT ceng DOT cea DOT fr (Eric NICOLAS)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: GRX20 Help!
Date: 4 Apr 1996 10:56:39 GMT
Organization: Commissariat a l'Energie Atomique
Lines: 34
Message-ID: <4k09t7$geq@news.cea.fr>
References: <4jvajm$9nj AT news DOT umbc DOT edu>
Reply-To: nicolas AT dsys DOT ceng DOT cea DOT fr
NNTP-Posting-Host: hudson.ceng.cea.fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019