OpenGL 1.X functions in gl3.h?

Hi,

since I’m switching to OpenGL 3.2 (core profile) I
replaced all gl.h and glext.h includes with gl3.h.

Now the compiler complains about missing OpenGL 1.X
functions like glGetString() or glGenTextures().
I checked the gl3.h header and noticed I’ll have to
bind these functions like extensions? Why is that?

In gl.h it was ready to use in this form:

WINGDIAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures);

Please note I have no problems with binding extensions,
I’m just interested in why such “oldschool” functions
suddendly are not ready to use in a new header.

And I’m not sure which role GL3_PROTOTYPES plays in
this game but I guess it should NOT be defined for
Windows platform.

Hope someone can enlighten me :slight_smile:

Thank you!

P.S. I know about GLEW, that is not the point here.

glGenTextures and others are there (gl3.h).

typedef void (APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);

But, you have to load them yourself.

So my first assumption is correct that one has to bind
them like an extension via wglGetProcAddress?

For example:

glGetError= (PFNGLGETERRORPROC) wglGetProcAddress("glGetError");

But this gives me 0 so I guess I have to bind them
in a different manner?

To load 1.x functions you must use LoadLibrary and GetProcAddress functions. See msdn docs.

Maybe this is off-topic, but where is gl3.h hiding if you work under Linux?

If your on windows there is a pthon script that will download the gl3.h file and create a gl3w.h file which can be used on windows. It basially auto generates all that proc address stuff. You should be able to google search to find the script.

/usr/include/GL3/gl3.h
(at least on my computer)

Thank you guys!

Really? Which driver do you have, I suppose ATI? I am using NVIDIA drivers and there’s no GL3 directory.

It was quite some time ago, I downloaded gl3.h from registry and copied it there myself (sorry, I forgot about that).

from gl3.h:

gl3.h should be placed under a directory ‘GL3’ and included as’<GL3/gl3.h>'.

but as I’m still using compatibility profile (slowly moving toward core) I include old gl.h and glext.h headers + some enums defined by hand instead of gl3.h