glActiveTextureARB(GL_TEXTURE0_ARB); causes crash
Im not sure why, but I know for sure that this is the only line of code causing my program to crash. Im not sure what you''d want to see to diagnos this problem, just ask I will provide. BTW mutlitexturing is set up properly, but it crashes here.
The error message you get would definitely help
Make sure that glActiveTextureARB is properly initialized (ie. is no NULL pointer).
Make sure that glActiveTextureARB is properly initialized (ie. is no NULL pointer).
I get a memory cannot be "read" error when it tries to execute the exe.
..
glActiveTextureARB(GL_TEXTURE0_ARB); <---- thats the linem that crashes, Im positive of it.
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D,m_texture.tex1.texID);
...
//------------------------------
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB= NULL;
PFNGLACTIVETEXTUREARBPROC glClientActiveTextureARB= NULL;
...
glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC) wglGetProcAddress("glMultiTexCoord2fARB");
glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress("glActiveTextureARB");
glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC) wglGetProcAddress("glClientActiveTextureARB");
I check for multitexturing support and no errors, and I check to see if the functions were properly gotten again no error.
Btw Im using sdl, not if that matter for the windows stuff.
[edited by - Evil-Prey on October 15, 2002 12:38:40 AM]
..
glActiveTextureARB(GL_TEXTURE0_ARB); <---- thats the linem that crashes, Im positive of it.
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D,m_texture.tex1.texID);
...
//------------------------------
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB= NULL;
PFNGLACTIVETEXTUREARBPROC glClientActiveTextureARB= NULL;
...
glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC) wglGetProcAddress("glMultiTexCoord2fARB");
glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress("glActiveTextureARB");
glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC) wglGetProcAddress("glClientActiveTextureARB");
I check for multitexturing support and no errors, and I check to see if the functions were properly gotten again no error.
Btw Im using sdl, not if that matter for the windows stuff.
[edited by - Evil-Prey on October 15, 2002 12:38:40 AM]
Make sure you get the function pointer after you have created a window. You need an active rendering context to get the function pointers.
Maybe that won''t help much, but you should replace :
with:
//------------------------------PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;PFNGLACTIVETEXTUREARBPROC glActiveTextureARB= NULL;PFNGLACTIVETEXTUREARBPROC glClientActiveTextureARB= NULL;...
with:
//------------------------------PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;PFNGLACTIVETEXTUREARBPROC glActiveTextureARB= NULL;PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB= NULL;...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement