Sign in to follow this  
Ksingh30

texture loading

Recommended Posts

hi. Im trying to load textures and I get this this run time error, when I ran the debugger I got the following errors: An unhandled exception of type 'Microsoft.DirectX.Direct3D.InvalidDataException' occurred in Microsoft.DirectX.Direct3DX.dll it breaks at this line texture = TextureLoader.FromFile(device, "test.bmp"); can someone explain what those errors mean?

Share this post


Link to post
Share on other sites
Fron what I understand from the C++ equivalent, it means that the data is invalid, meaning that test.bmp is not a valid windows bitmap. Does it open fine in Windows picture viewer thing and in paint?

It's also possible that the device can't create a texture of the correct texture format, but never having used TextureLoader.FromFile, I don't know if that's possible / likely.

Share this post


Link to post
Share on other sites
The bitap may well be valid, but unless D3DX can find it, that's moot.

If the bitmap is in the project directory, try ".//test.bmp", otherwise qualify the path somehow (absolutely, if necessary, during testing).
I'm not familiar with C# or MDX so I would check to make sure the D3DDevice you're passing is valid. Failing that, your texture loading function may need some attention (particularly if it is using D3DXCreateTextureFromFileEx).

Regards
Admiral

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