PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB= NULL;
PFNGLACTIVETEXTUREARBPROC glClientActiveTextureARB= NULL;
glActiveTextureARB(GL_TEXTURE0_ARB);
🔒 Locked
glActiveTextureARB crash
Advertisement
Original Post
Hi all ! Im trying to get this working so I can do some bump maping, sadly I dont know why my program crashes when I load this line glActiveTextureARB(GL_TEXTURE0_ARB); This is what I do to initialize: Any ideas ? Btw Im using GLee for the extensions THanks!
hm, you're wondering why your programs crashes when you call a NULL-function? ;)
dunno about glee, but you usually have to get the proc address before you can call the function.
like that (when you're using windows):
dunno about glee, but you usually have to get the proc address before you can call the function.
like that (when you're using windows):
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress((LPCSTR)"glActiveTextureARB");
yeah I was wondering the same thing but I change it because I saw a sample here at the forums.
Btw the way you said dosent work, still crashes :(
Btw the way you said dosent work, still crashes :(
that was the first thing I tried, include the header, lib is linked, but still dosent work, I get glActiveTextureARB' : undeclared identifier if I dont initialize.
Have u defined the type PFNGLACTIVETEXTUREARBPROC before using it?
like this :
typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum target);
after that u need to define variable glActiveTextureARB like what u did :
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB= NULL;
after that did u init the varible like what cmf said :
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress((LPCSTR)"glActiveTextureARB");
btw if u used this way u don't need to include any extension lib,
so u need to do this process for each function u need to use it.
like this :
typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum target);
after that u need to define variable glActiveTextureARB like what u did :
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB= NULL;
after that did u init the varible like what cmf said :
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress((LPCSTR)"glActiveTextureARB");
btw if u used this way u don't need to include any extension lib,
so u need to do this process for each function u need to use it.
Even If Im using Glee? that was the point of using it... not having to initialize everything everytime I use it.
Quote:
Original post by juanmanuelsanchez
that was the first thing I tried, include the header, lib is linked, but still dosent work, I get glActiveTextureARB' : undeclared identifier if I dont initialize.
Don't declare any extension functions yourself. Just #include GLee.h and make sure you've got an OpenGL context before you call any GL functions or use any extension querying variables.
To be extra safe, you can GLeeInit() after you've got your GL context and check whether it returned GL_TRUE (success) or GL_FALSE (failure). If it returns GL_FALSE then you should check the error with GLeeGetErrorString()
Before using an extension function, you should check that your drivers support it by using the GLee querying variable for that extension (e.g. GLEE_ARB_MULTITEXTURE).
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement