texture loading
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?
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.
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.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement