OpenGL header problems

Harold L Hunt II huntharo@msu.edu
Mon Mar 1 05:34:00 GMT 2004


As I mentioned in my email about enabling indirect OpenGL acceleration, 
there are some problems when trying to link to -lopengl32.

I tracked this down to problems with the way that 
/usr/include/w32api/GL/gl.h decorates the function declarations for the 
gl* functions.  There are some collisions between the way that the 
standard windows headers define WINGDIAPI and APIENTRY and the way that 
gl.h expects them to be.

However, the problem is a little trickier than just that: I added a call 
to glPixelStorei in Xserver/hw/xwin/InitOutput.c (without #including any 
opengl headers) and instead made my own prototype for glPixelStorei.  If 
I made it:

void __stdcall glPixelStorei (unsigned int, int);

then the linker would complain about how it had to fixup a reference to 
glPixelStorei as _glPixelStorei@8.  But that is exactly what the 
__stdcall was supposed to do, so I am getting a little confused about 
why the prototype was being ignored.

I need an expert on __stdcall and w32api headers to give me a hand here. 
  Igor, I saw a post you made on this subject before, so I am counting 
on you :)

Once this little trick is solved we will have to figure out how to get 
the proper headers in exports/include/GL/; that directory currently 
getes some Mesa headers in it.  I'm not sure if we can cleanly disable 
that and point to the w32api OpenGL headers instead.

Harold



More information about the Cygwin-xfree mailing list