This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Cygnus GCC with Microsoft Direct X?


Greetings all,

I have a fairly old version of Cygnus GCC (cygnus-2.7.2-960126) which I am trying to get to work with Microsoft's DirectX version 2 graphics library. It appears that this version of Cygnus GCC does not support COM interfaces (I believe ole2.h is the necessary header file which is missing), which makes compiling DirectX examples fairly difficult. Instead of using the DirectX COM interface I tried to use the plain C DirectX interface by #defining CINTERFACE, though getting the darn thing just to compile required practically rewriting the entire ddraw.h header file (such rigamarole as running the whole header file through the C preprocessor and cutting and pasting the interface (struct) definitions for IDirectDraw and other classes).

Anyway I did manage to successfully call DirectDrawCreate (though I had to create my own import library using dlltool.exe) and this apparently returns with a DDOK result. However the pointer I have to the (supposedly initialized) DirectDraw object apparently points to garbage, for as soon as I try to call a method in the virtual method table (DirectDraw->lpVtbl->SetCooperationLevel, for instance, or any other method), the program exits with Signal 7 (I assume this is some sort of a segfault).

I suspect that either (1) in my attempts to translate the ddraw.h to a cygnus-compilable form, I somehow altered the size of some vital structure and thus all elements are at different offsets than DirectDrawCreate expects, thus yielding pointers to garbage, or (2) the pointer I am passing to DirectDrawCreate (actually a pointer to a pointer) is somehow not in the correct format. I have only a foggy notion of how pointers and memory are handled under Win32, but I can imagine [based on my DOS programming experience] that somehow selectors or offsets might have different ways they can be passed to other functions and that it could make a big difference if I am passing a pointer in the incorrect format.

Any ideas or suggestions? Would a newer version of Cygnus GCC help? 

Please cc: any responses directly to me (nlin@getnet.com) since due to the high traffic on this list I cannot be subscribed regularly to the list (slow and expensive net connections, sigh).

Thanks
-Norman Lin
 nlin@getnet.com


-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]