PDA

View Full Version : opengl extensions and include files



therealremi
12-20-2006, 04:38 AM
I want to use some opengl extension. What do I have to do in code to enable it? I know it is supported on my system. So should I download a file:
http://oss.sgi.com/projects/ogl-sample/ABI/glext.h
and include it? Or maybe this file:
http://oss.sgi.com/projects/ogl-sample/ABI/wglext.h?
But here:
http://oss.sgi.com/projects/ogl-sample/ABI/
they write "glext.h is normally included by gl.h", so I don't have to do anything?
I took a look at:
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include\gl\gl.h
and there is no single #include in this file.
Btw. is there anything specific about these microsoft GL headers? Are there any other GL headers that I can use instead to get more functionality?

You see that I'm completely lost with this headers stuff, so any explanation would be welcome. Cause this:
http://www.opengl.org/resources/faq/technical/extensions.htm
is a very poor faq for beginners.

k_szczech
12-20-2006, 07:17 AM
Try this little library:
http://glew.sourceforge.net

songho
12-20-2006, 10:53 AM
therealremi,
You need to include "glext.h" in order to use extensions. "wglext.h" is only for Windows specific extensions, such as "WGL_EXT_swap_control".

"gl.h" does not include "glext.h", so you have to include "glext.h" yourself in your codes. Or use extension helpers, such as gluX, glee, glew...

therealremi
12-20-2006, 03:26 PM
I took a look at glew and glee and I'm gonna use the latter. Unless there is really some reason I should code support for extensions myself.

V-man
12-23-2006, 07:28 PM
I don't get it. Is this information in the wiki or not? I see the same question appear every week.
It's in the "Getting Started" section

Komat
12-24-2006, 08:38 AM
Originally posted by V-man:
I don't get it. Is this information in the wiki or not? I see the same question appear every week.
This might be caused by the fact that the link to the forums can be found more easily on the main page than link to the wiki.

The forum link is directly visible on top of the main page while link to wiki is (as far as I know) within the "Coding Resources" menu under "Technical FAQ Wiki". I am not sure if I would expect to find "Getting started" section in such place. Having Wiki link with more beginner friendly name positioned above the "Message Boards" link on the main page might be useful.