texture loading

Started by
2 comments, last by TheAdmiral 17 years, 7 months ago
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?
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.
yes the test.bmp is valid, I evebn tried jpg still didnt work.
same problem.
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
Ring3 Circus - Diary of a programmer, journal of a hacker.

This topic is closed to new replies.

Advertisement