Sign in to follow this  
zauron

D3DXCreateTextureFromFile exeption

Recommended Posts

zauron    122
EDIT: Stupid me i called it on a object that was just a pointer :/ original: i am trying out the sprites in D3DX and am right now trying to load a texture, but it seams it throws an exeption in the following code when i enter an illegal filename, i get the error. but if i use a file that exist i get an exeption, or at least that is what vs.net tells me texture is defined like this: LPDIRECT3DTEXTURE9 texture;
bool Object::loadTexture(char *filename)
{
	if( D3DXCreateTextureFromFile( p_d3ddevice, filename, &texture ) != D3D_OK ){
    MessageBox(hWnd, filename, "Could not load texture", 0);
		return false;
	}

	return true;
}


[Edited by - zauron on February 16, 2005 7:05:51 AM]

Share this post


Link to post
Share on other sites
zauron    122
did a search seams like someone had this problem before

link

tried adding the texture variable as a local variable in the loadTexture function, that worked as it should, but that is not what i want.

The place i call the loadTexture code is in a class that inherits it from Object, can that cause this?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this