Archived

This topic is now archived and is closed to further replies.

Evil-Prey

glActiveTextureARB(GL_TEXTURE0_ARB); causes crash

Recommended Posts

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.

Share this post


Link to post
Share on other sites
The error message you get would definitely help

Make sure that glActiveTextureARB is properly initialized (ie. is no NULL pointer).

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
Maybe that won''t help much, but you should replace :

  
//------------------------------

PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB= NULL;
PFNGLACTIVETEXTUREARBPROC glClientActiveTextureARB= NULL;
...


with:
  
//------------------------------

PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB= NULL;
PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB= NULL;
...

Share this post


Link to post
Share on other sites