Jump to content
  • Advertisement

Archived

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

Evil-Prey

glActiveTextureARB(GL_TEXTURE0_ARB); causes crash

This topic is 5901 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
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 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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!