PDA

View Full Version : Best place to get OpenGL header files?



Lucan1d
08-26-2011, 05:00 PM
I am using MinGW and the gl.h file that's included with it seems to be missing numerous symbol definitions that I see used in common code such as glDeleteBuffers, glBindBuffer etc. Also, it doesn't have a glext.h.

While I can see on the opengl.org website a place to get glext.h, is there a "standard" place to find OpenGL headers files in general such as gl.h? And is it just a matter of me "plugging in" these headers into my MinGW environment and then expecting them to work?

Alfonse Reinheart
08-26-2011, 06:04 PM
The correct solution is to use an extension loading library (http://www.opengl.org/wiki/Extension_Loading_Library).

Lucan1d
08-26-2011, 07:05 PM
I think you may have misunderstood my question. I am looking for a place to find something as basic as an up-to-date gl.h. I haven't even begun to look at extension handling yet.

mhagain
08-26-2011, 07:15 PM
I think you may have misunderstood the answer. ;)

There is no up to date gl.h; use of an extension loading library is fairly standard for obtaining access to the newer entry points. The alternative is to obtain a glext.h and load the newer entry points by hand, but that's a world of pain and suffering.

Lucan1d
08-26-2011, 07:30 PM
Yes, I think I missed this important statement in the reference:

"Most extension loading libraries override the need to include gl.h at all."

So why is all of the OpenGL code I have seen written using gl.h and not using extension libraries? Are extension libraries the option of choice for a modern OpenGL programmer?

Aleksandar
08-27-2011, 04:48 AM
"Most extension loading libraries override the need to include gl.h at all."
Some extension handling libraries do not require additional inclusion of gl.h because they already include it.


So why is all of the OpenGL code I have seen written using gl.h and not using extension libraries? Are extension libraries the option of choice for a modern OpenGL programmer?
The extension handling libraries just alleviate access to OpenGL functionality built in drivers. I, personally, don't use them, but is a matter of choice. In any case, if you don't grab the pointers to the function, on Windows platforms you'll be stuck at OpenGL 1.1. gl.h is a header file to that basic functionality. glext.h extends it by adding signatures for other functions which you need to know in order to query them from the driver. Also, you'll need a wglext.h.

Why don't you read a suggested topic about extensions first?