Hi, Demmer
The advantage of a native port would be that cygwin comes with libtiff, libjpeg and libpng.
Well, I have these libs with Mingw, but...
Anyway, my problem was that MinGW defines __WIN32__, whereas cygwin defines _CYGWIN32__. So I had no framedriver in ftable.c :-(
this diff to the grx20.h would be the standard grx mode to support a new plattform:
=========== cut here ========= --- grx20.old Sat Oct 26 22:51:14 2002 +++ grx20.h Wed Jan 22 19:03:34 2003 @@ -47,6 +47,7 @@ /*#define GRX_VERSION_WATCOM_REAL_MODE 6*/ /* GS - Watcom C++ 11.0 16 Bit - TODO! */ #define GRX_VERSION_GCC_386_WIN32 7 /* WIN32 using Mingw32 */ #define GRX_VERSION_MSC_386_WIN32 8 /* WIN32 using MS-VC */ +#define GRX_VERSION_GCC_386_CYG32 9 /* WIN32 using CYGWIN */
#define GRXMain main /* WIN32 targets undef it */
@@ -65,7 +66,12 @@ #define GRX_VERSION GRX_VERSION_GCC_386_WIN32 #undef GRXMain #endif +#ifdef _CYGWIN32__ +#define GRX_VERSION GRX_VERSION_GCC_386_CYG32 +#undef GRXMain +#define __WIN32__ _CYGWIN32__ #endif +#endif /* __GNUC__ */
#ifdef __WATCOMC__ /* GS - Watcom C++ 11.0 */ #ifdef __DOS__
=========== cut here =========
I am not sure if this fixes all issues, because I also changed vd_win32.c to not create the thread calling GRXMain, but rather create a thread that creates the graphics window and dispatches the messages.
Please post your modified video driver here, if it doesn't hurt the Mingw port it will be ok, or (not desirable) we can have a special version for Mingw.
This was easy enough to do by creating grx.dll instead of libgrx.a and do the initialization in DllMain(). Thinking about this, I see no point why this cannot be moved to frame buffer creation stage... Hmm, I'll have a look into that.
You seem to know well the Windows platform and the GRX Win32 video & framedrivers have lot of problems/bugs. So you are welcome to improve it. As a suggestion (I have in my to do list for some day), the best thing will be to catch the window memory address and let the standard GRX framedrivers do the work.
A question about CygWin I'm not sure is license. I think CygWin programs must be GPL and GRX is LGPL. I don't know if this is a problem.
Greetings, M.Alvarez