PDA

View Full Version : using Multitexturing



Mickey_dup1
03-14-2006, 07:51 AM
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\n");
glActiveTextureARB(GL_TEXTURE0_ARB);
printf("after active multiTexturing\n");
glDisable(GL_TEXTURE_2D);

CWiC
03-14-2006, 08:13 AM
Probably you need to activate your function pointer with something like wglGetProcAddress or use one of extention loading library (for example glew).

Mickey_dup1
03-14-2006, 10:58 AM
I don't understand how. I'm a newbie. I have incuding <GL/glew.h>...but occur this error at runtime..

Poons
03-15-2006, 03:31 AM
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)

sqrt[-1]
03-16-2006, 03:03 AM
If you are using glew, ensure you have initialized it. (eg. called glewInit()? once you have a render context)

Mickey_dup1
03-16-2006, 06:04 AM
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