Jump to content
  • Advertisement
Sign in to follow this  
Ksingh30

texture loading

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

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!