Jump to content

  • Log In with Google      Sign In   
  • Create Account

SOIL unhadled exception


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Neomex000   Members   -  Reputation: 100

Like
0Likes
Like

Posted 07 January 2012 - 03:29 PM

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
		(
		"bg.png",
		SOIL_LOAD_AUTO,
		SOIL_CREATE_NEW_ID,
		SOIL_FLAG_INVERT_Y
		);

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


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

	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	*/
		if(
			(NULL == strstr( (char const*)glGetString( GL_EXTENSIONS ),
				"GL_ARB_texture_non_power_of_two" ) )
			) //############ it points here ############//
		{
			/*  not there, flag the failure */
			has_NPOT_capability = SOIL_CAPABILITY_NONE;
		} else
		{
			/*  it's there! */
			has_NPOT_capability = SOIL_CAPABILITY_PRESENT;
		}
	}
	/*  let the user know if we can do non-power-of-two textures or not */
	return has_NPOT_capability;
}

Am I missing other initialisations?

Posted Image

Uploaded with ImageShack.us

Sponsor:

#2 Caste   Moderators   -  Reputation: 969

Like
1Likes
Like

Posted 28 January 2012 - 08:37 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS