Jump to content
  • Advertisement
Sign in to follow this  

SOIL unhadled exception

This topic is 2825 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

I've wrote about this problem in few forums, but no one was able to help me.

I am trying to load texture into OpenGL using soil with something like this:
int LoadGLTextures()
/* load an image file directly as a new OpenGL texture */
texture[0] = SOIL_load_OGL_texture

if(texture[0] == 0)
return false;

// Typical Texture Generation Using Data From The Bitmap
glBindTexture(GL_TEXTURE_2D, texture[0]);

return true; // Return Success

And call
glEnable( GL_TEXTURE_2D );
glShadeModel( GL_SMOOTH );

before it.
App launches and returns unhandled exception here:
// SOIL.c
int query_NPOT_capability( void )
/* check for the capability */
if( has_NPOT_capability == SOIL_CAPABILITY_UNKNOWN )
/* we haven't yet checked for the capability, do so */
(NULL == strstr( (char const*)glGetString( GL_EXTENSIONS ),
"GL_ARB_texture_non_power_of_two" ) )
) //############ it points here ############//
/* not there, flag the failure */
} else
/* it's there! */
/* let the user know if we can do non-power-of-two textures or not */
return has_NPOT_capability;

Am I missing other initialisations?


Uploaded with ImageShack.us

Share this post

Link to post
Share on other sites
Sorry for the late answer, but to me it sounds like OpenGL is not yet initialized, e.g. you call your LoadTextures method before the window is actually showing up...

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!