Hi.
From utils/dbgprint.c:
40:void _GR_debug_printf(char *fmt,...) ... 56:#ifndef __XWIN__ 57: if (GrKeyPressed()) { 58: if (GrKeyRead() == GrKey_Escape) exit(1); 59: } 60:#endif
Can we please remove this? There are many calls to DBGPRINTF() before the video driver is initialized, and in these calls the invokation of GrKeyPressed()/GrKeyRead() attempts to initialize the input driver, which is generally impossible if the video driver is not yet initialized. As a result, this code fails on X11 and Win32 (InitializeCriticalSection() is never called => "invalid page fault in module KERNEL32.DLL"), and on svgalib the GrKeyPressed() call acts as GrKeyRead() before video the init.
By removing this we will also be able to remove the linking of any programs that call GRX functions but have no video output against the underlying graphics libraries. For example, fnt2c is linked with -lvga (or -X11, or whatever) only because it's debug version requires the input driver, which requires the video driver, which in turn requires the graphics libraries. That is, we'll at last be able to separate the different UTILP* programs.
BTW, the MinGW Win32 DEBUG version of fntc2 still doesn't link because of this issue: it's link command lacks -lwindows -lconsole. Not that is works.
Thus, instead of making the debugging more comfortable, this code actually breaks the debugging functionality on some (all but MSDOS?) platforms.
E-gards: Jimmy