Mail Archives: djgpp/1998/01/08/11:01:10
Gary wrote:
>
> Once again I.m here to pick someones brain,I need to know how the user
> functions are used within the grx22 graphics library,if someone could point me
> to a place where there is some documentation or code written for this I would
> be eternally grateful.
Have a look at the doc subdir in contrib/grx, there's API.DOC from grx
v1.03
This documentation is general still valid for grx v2 but in case of
trouble you should also check at least grx20.h for correct definition!
AFAIK, currently no one works on new up to date doc's for GRX :(
> OK,I have been able to access these functions and use them,but what i would
> like to know if graphics drawn on the user screen can be transferred,blitted to
> a (context,subcontext)?,I have looked through the source code of the library
> and have not seen anything there that does that,however that dos'nt mean its
> not there<G>.
Well,
char *memory[4];
int ps = GrPlaneSize(w,h); /* width and height of your sub context */
int np = GrNumPlanes();
int i;
GrContext *gc;
/* allocate bitmap memory */
for (i=0; i < np; ++i) {
memory[i] = malloc(ps);
assert(malloc!=NULL);
}
while (i<4) memory[i++] = NULL;
GrCreateContext(w,h,memory,gc); /* build the context in memory */
GrBitBlit(gc, 0, 0, /* destination : memory context */
NULL, left, top, left+w-1, top+h-1, /* source: screen */
GrWRITE /* copy, no operator applied */ );
I did this example from memory and didn't compile and run it. So take
some care ...
Hartmut
--
Hartmut Schirmer | Phone: +49-431-77572-709 FAX:-703
Automatisierungs- & Regelungstech. | hsc AT techfak DOT uni-kiel DOT de
Technische Fakult"at, | http://www.techfak.uni-kiel.de/~hsc
Kaiserstr. 2, 24143 Kiel, Germany | PGP key via WWW, Key ID:6D84AEC1
- Raw text -