Hi. The following code:
#include <grx20.h>
int main(void) { GrLoadFont("d:/media/grx247p1/fonts/char30b.fnt"); GrSetMode(GR_width_height_bpp_graphics, 640, 480, 8); Sleep(1000);
return (0); }
at least when run in 16/32bpp, results in a green screen (or window, depending in the resolution) on my system. I had this issue with fontdemo; both work properly [black screen/window] without the GrLoadFont() call.
The problem seems to be with vd_win32.c:setmode(). It creates an 8bpp DIB and then uses a solid color 0 brush to clear it. But while the chances are color 0 (in 8bpp) will be RGB 0, that's not granted.
Shortly after init the GRX window is updated, the DIB is copied into it, and so it's filled with some non-black color (usually a nice one, I must admit :-)
Now, I fixed this by setting the DIB color index 0 to 0, and to be 101% sure, used a BitBlt(hDC, hDCMem) instead of FillRect() to initially clear the GRX window in 8bpp. It doesn't seem to matter, as the GRX window is updated (almost) immediately, and thus fixing the DIB color 0 is enough. Even removing BitBlt() and FillRect(hDC) makes no visual difference for what I've tested. But anyway...