using Multitexturing

Hi, I’m trying to enable multitexturing (my video support it!), but on glActive below, my application crash and appear ‘report bug error’ (i’m under winXP). Why this? Thanks

glEnable(GL_TEXTURE_2D);
printf("active multiTexturing
");
glActiveTextureARB(GL_TEXTURE0_ARB);
printf("after active multiTexturing
");
glDisable(GL_TEXTURE_2D);

Probably you need to activate your function pointer with something like wglGetProcAddress or use one of extention loading library (for example glew).

I don’t understand how. I’m a newbie. I have incuding <GL/glew.h>…but occur this error at runtime…

you can get the function pointer the following way:

PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) wglGetProcAddress(“glActiveTextureARB”);

you should check the pointer afterwards if it is null (in that case wglGetProcAddress wasn’t successful)

If you are using glew, ensure you have initialized it. (eg. called glewInit()? once you have a render context)

Originally posted by sqrt[-1]:
If you are using glew, ensure you have initialized it. (eg. called glewInit()? once you have a render context)
Thanks it was this. I also make glewInit() but in a wrong place…bye