Hi list, here are (hopefully) my final words on the changes to vdriver/vd_win32.c
The patch does the following: * It removes the ugly GRXMain construct. Instead, when the Win32 driver is initialized and setmode() is called, a helper thread and the graphics window is created. * If somebody tries to close the graphics window, a dialog pops up warning that this will kill the application. If confirmed, the application is terminated. The main thread is not suspended, this dialog is non-modal to the application.
Implications: * demo/keys.exe now segfaults, because it tries to use the message queue before it is set-up. I consider this a bug in keys.c that one has to work around the same way as for the X11 case. Alternatively, the key and mouse routines should check for the existence of a graphics window and call setmode() accordingly. * For gpc you have to remove the references to GRXMain in pascal/grx.pas, and maybe in other places.
* All other tests succeed under MinGW. * All test fail under cygwin when called from demogrx. Reason: demogrx calls system(".\foo"); instead of system("./foo"); * All other tests succeed when called directly. * speedtst doesn't compile under Cygwin because <values.h> is missing (which is, funny enough, empty in mingw :-)) .
Other: * If vd_win32.c is compiled with -DUSE_DIB (very experimental) support for a device independent bitmap of the graphics window is enabled. This works at least OK for the 24 bpp mode and seems to speed up BitBlts pretty much. There are up to now some issues in coordinating main and helper thread, but that seems to be only a matter of adding another CriticalSection() semaphore. This weekend I'll be snowboarding, it may take some time to implement...
* If you change the $(AR) and $(RANLIB) lines in the Makefile to (all in one line) $(CC) $(CCOPT) -shared -Wl,--output-def=grx.def \ -Wl,--out-implib=libgrx.dll.a -o grx.dll $(ALL_O) $(ADDON_L)
you get a nice dll and a link-lib. (Under bash, no ideas if cmd.exe groks $(ALL_O) ) this works with both 'CC=gcc' and 'CC=gcc -mno-cygwin'
Happy hacking,
Ciao Tom
<<vd_win32.pat.0130>> <<grx20.pat.0128>>
Thomas Demmer Kraft Foods R&D Munich Phone: +49 89 62738-6302 Fax: +49 89 62738-86302
Thought of the Day: A real friend isn't someone you use once and then throw away. A real friend is someone you can use over and over again.
Demmer, Thomas wrote:
- For gpc you have to remove the references to GRXMain in pascal/grx.pas,
and maybe in other places.
pascal/grx.pas and pascal/bgi/graph.pas
Frank