PDA

View Full Version : OpenGL headers: gl.h & glext.h



marcus256
08-29-2001, 03:11 AM
My problem:

I use MinGW (for Windows) which has its own gl.h file with minor support for extensions (some extensions are in there, but not the function typedefs for the extensions).
I downloaded the glext.h file form oss.sgi.com that seems to be fairly complete (only lacks some ATIX extensions, which are probably not official anyway). The problem is that my gl.h file and the glext.h file is in bad conflict, meaning that I can not use extensions at all.

Now, I can rewrite my gl.h file and remove all the extensions from it so that it is compatible with glext.h, but what is the real solution? I want my program to compile with other people's compilers and include files aswell? Is there an official, clean, gl.h file, just as there is a glext.h file?

/Marcus

ffish
08-29-2001, 03:16 AM
Mesa's probably got a nice clean gl.h. Look for it with google - it's at sourceforce IIRC.

Hope that helps.

marcus256
08-29-2001, 03:31 AM
Originally posted by ffish:
Mesa's probably got a nice clean gl.h. Look for it with google - it's at sourceforce IIRC.


Thanks. Tried it, but it also follows the same standard:
1) declare flags that extensions are supported
2) define extension tokens
3) define extension prototypes
4) does NOT define extension function typedefs

=> conflict with glext.h

Am I doing this the wrong way?

As I see it, it would all work if I could include glext.h BEFORE I include gl.h (so that glext.h would have priority over gl.h), but that is not possible since glext.h needs the typedefs in gl.h.

/Marcus

[This message has been edited by marcus256 (edited 08-29-2001).]

marcus256
08-29-2001, 03:59 AM
Solved!

I used the gl.h file from the MESA distribution, and made a very small change to it (so that it treats GL_ARB_multitexture as an extension that is declared in glext.h, just as it does with all the other extensions).

/Marcus