Closed SkyLeite closed 3 months ago
It seems you are loading the data directly off the PNG file. The byte slice you supply as texture needs to be in the R8G8B8A8 format. You can get that by using a crate such as image
to decode the PNG into said format.
Oh, that makes sense! I figured since that's how I was loading them before with D3Dx9CreateTextureFromFile
, it'd work the same way here. Thank you! :)
Hi! I'm trying to use the new
load_texture
API introduced in 0.7.0 with DirectX 9, but attempting to load a texture gives me this error:This is the file being loaded:
And here's my code:
The only way I could get this to not crash at runtime was to set the
width
andheight
parameters to 10, for some reason, but then of course the texture is loaded incorrectly.