• ### Announcements

#### Archived

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

# 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 on other sites
The error message you get would definitely help

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

##### 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;
...

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 on other sites
Make sure you get the function pointer after you have created a window. You need an active rendering context to get the function pointers.

##### 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;...