Hi Waldemar.
I think there are two minor inconsistencies in the doc:
Setting video modes
Before a program can do any graphics drawing it has to configure the graphics driver for the desired graphics mode. It is done with the GrSetMode function as follows:
==>void GrSetMode(int which,...);
I think the above line should read int GrSetMode(int which,...);
returning non zero (TRUE) on success.
OK, thanks.
Graphics cursors
The library provides support for the creation and usage of an unlimited number of graphics cursors. An application can use these cursors for any purpose. Cursors always save the area they occupy before they are drawn. When moved or erased they restore this area. As a general rule of thumb, an application should erase a cursor before making changes to an area it occupies and redraw the cursor after finishing the drawing. Cursors are created with the GrBuildCursor function:
==>GrCursor *GrBuildCursor(char far *pixels,int pitch,int w,int h, int xo,int yo,GrColorTableP c); ==>GrCursor *GrBuildCursor(char *data,int w,int h,int xo,int yo,GrColorTableP c);
I think one of the above two lines is obsolete or has a typo in it ?
Thanks again, I forgot to delete the second one.
BTW, do you know why that line in src/bgi/clrdev.c is commented out ?
void __gr_cleardevice(void) { _DO_INIT_CHECK; GrResetClipBox(); GrFilledBox( 0, 0+PY, getmaxx(), getmaxy()+PY, BLACK); __gr_Reset_ClipBox(); ==>/* GrClearScreen(__gr_colorbg); */ moveto( 0, 0); }
I don't know. Perhaps GrFilledBox do the work faster. Harmuth, are you there?
Mariano Alvarez Fernandez schrieb:
void __gr_cleardevice(void) { _DO_INIT_CHECK; GrResetClipBox(); GrFilledBox( 0, 0+PY, getmaxx(), getmaxy()+PY, BLACK);
^^^^^
__gr_Reset_ClipBox(); ==>/* GrClearScreen(__gr_colorbg); */
^^^^^^^^
moveto( 0, 0); }
I don't know. Perhaps GrFilledBox do the work faster. Harmuth, are you there?
May be, but AFAIK BGI docs say the screen will be filled with background color, not unconditionally BLACK, as GRX does in this case. But that's a minor thing, anybody can change this easily to fit his requirements. I was just curious about it.
Much more interesting: How to _safely_ change GrSetDriver() and/or _GrCloseVideoDriver() so that the screen will NOT be cleared at exit() when we are already back in that text mode we were in, when GrSetMode() was invoked for the first time. ["atexit(_GrCloseVideoDriver);" in GrSetDriver() in src/setup/setdrvr.c]
BTW, do you know why that line in src/bgi/clrdev.c is commented out ?
void __gr_cleardevice(void) { _DO_INIT_CHECK; GrResetClipBox(); GrFilledBox( 0, 0+PY, getmaxx(), getmaxy()+PY, BLACK); __gr_Reset_ClipBox(); ==>/* GrClearScreen(__gr_colorbg); */ moveto( 0, 0); }
I don't know. Perhaps GrFilledBox do the work faster. Harmuth, are you there?
PY is used to simulate different graphic pages. The GrClearScreen() is a left over from the first GRX v1.x implentation. In GRX v2.0 all graphics screens would be cleared, not just the active one.
Delete that line
Hartmut