PDA

View Full Version : OpenGL files



Snapshot
07-28-2006, 02:15 AM
I'm now working with OpenGL since a few months and everything works fine. But one thing makes me mad: Where can I get the required header, lib and dll files !? Even on opengl.org there seems to be no download for them.
Sure by installing a visual studio to my computer I already have a version of gl.h, glu.h etc. installed. But where can I update them? What do I have to do if I want to develop with OpenGL 2.0?

Relic
07-28-2006, 05:41 AM
Official headers are here: http://www.opengl.org/registry/

Hardware vendors have similar headers in their SDKs. Look on the developer sites at NVIDIA or ATI for example.

You cannot update the OpenGL dlls, they are system files, and that also means you don't need newer libs, because every function beyond OpenGL 1.1 needs to be initialized by wglGetProcAddress, like it's done for OpenGL extensions.
You can use a convenient wrapper library like GLEW to do that for your: http://glew.sourceforge.net/

"What do I have to do if I want to develop with OpenGL 2.0? "

You need to have an OpenGL 2.0 capable graphics board (for example GeForce 5xxx and up, GeForce 6xxx and up recommended because of the shader model 3.0 features) and the proper graphics drivers installed.

Snapshot
07-28-2006, 06:54 AM
Thanks for your reply!

"You cannot update the OpenGL"

Did I get you right ? Example: If I have two gl.h header files with different date and size, one of them must be corrupted because there exists only one version of this header?

"...every function beyond OpenGL 1.1 needs to be initialized by wglGetProcAddress..."

So if I want to use things like glBeginQuery(), as it's specified in the ogl spec 2.0, such new functionality is declared in glext.h only.

I'm quiet unexperienced to all these extensions. is there a good tutorial showing how to use them ?

Relic
07-28-2006, 08:01 AM
"Example: If I have two gl.h header files with different date and size, one of them must be corrupted because there exists only one version of this header?"

Not really. The one which comes with your Visual Studio installation is good to go with all OpenGL 1.1 functions supported natively by the Microsoft's system file OpenGL32.dll. There is no need to update gl.h normally.
If you find one which contains all core OpenGL functions up to version 2.0 you can also use that, the linker will just not find entry functions beyond version 1.1 in the OpenGL32.lib of your compiler and all those functions need to be dynamically queried once from the OpenGL implementation when it's running. That's a lot of hassle (but preserves backward compatibility of older hardware).

Everything not in the core but specified by extensions can be found in glext.h.
All core functions and most extensions are known to GLEW and it does the function pointer address loading for you.

Because extensions can be vendor specific the "official" glext.h maybe older than what vendors have in their SDKs.

If you have any extension's spec you can generate the new function prototypes and enums yourself and add them to your private glext.h if you like. Noone keeps you from building the knows-all header file.

If you have an ATI or NVIDIA board, just download the resp. SDK and see how they do it.
Necessary headers should be included there as well.

Snapshot
07-28-2006, 08:54 AM
Okay, that makes sense. Thank you very much!!

Relic
07-28-2006, 10:26 AM
Happy coding. ;)