opengl extensions

hi there,

glext.h says the following:

#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glActiveTextureARB (GLenum);

now the problem is that GL_GLEXT_PROTOTYPES apparently isn’t defined on my system, so glActiveTextureARB(…) is also unavailable, which would be quite fine if i didnt need it, but unfortunately i do.

so does anyone know what libraries/includes/?? i’m missing and where i could get them?

thanks a lot!

system: win2000sp4, athlon xp1800, geforce4 mx440

Under Windows you will need to use wglGetProcAddress(). glext.h should have typedefs for the function pointers you need so you would do something similar to:

PFNGLACTIVETEXTUREPROC glActiveTextureARB = wglGetProcAddress(“glActiveTextureARB”);

Note: You have to do this AFTER you have a valid GL context created.

Edit: Also should note that you should check the version/extensions string with glGetString first. And if your version is >=1.3(?) for this particular function you should be able to use “glActiveTexture” instead of “glActiveTextureARB.”

[This message has been edited by Deiussum (edited 11-27-2003).]

in case you didn’t fix this yet:

if GL_GLEXT_PROTOTYPES isn’t defined, well, then, define it!

#define GL_GLEXT_PROTOTYPES
#include “GL/gl.h”
#include “GL/glu.h”
#include “GL/glext.h”

Jan

i think that was the first thing i actually tried :wink:
but i solved it by now.

thanks anyhow!

Originally posted by JanHH:
[b]in case you didn’t fix this yet:

if GL_GLEXT_PROTOTYPES isn’t defined, well, then, define it!

#define GL_GLEXT_PROTOTYPES
#include “GL/gl.h”
#include “GL/glu.h”
#include “GL/glext.h”

Jan[/b]

That’d get rid of the error saying it’s not defined, but then you would get a linker error since opengl32.lib doesn’t have an entry point to any of those functions. Under Windows, you have to use the function pointer typedefs and wglGetProcAddress().