Managed DirectX - TextureLoader.FromFile auto-scales?

Started by
0 comments, last by The Frugal Gourmet 19 years, 3 months ago
Im trying to load a huge texture (4096x4096) but when i load it like so:

//Load the texture into a temp storage
Microsoft.DirectX.Direct3D.Texture tempTexture = Microsoft.DirectX.Direct3D.TextureLoader.FromFile(device.mDevice, fn);

int widthDelta = tempTexture.GetSurfaceLevel(0).Description.Width - caps.MaxTextureWidth;
int heightDelta = tempTexture.GetSurfaceLevel(0).Description.Height -  caps.MaxTextureHeight;



tempTexture.GetSurfaceLevel(0).Description.Width is 2048 ( down from 4096) and the same goes for the height... Why is it autoscaling? Am i wrong? And if im right, how do i stop it! Regards. Ash. [Edited by - Asheh on December 29, 2004 6:24:51 PM]
Advertisement
Yes, it will do that if your video card does not support the target scale as a target size. It will do the same if your card does not support oddly-sized textures and you try to load one of those.

If you want to load textures this size, try loading them into memory as a surface and then slicing them into smaller textures.

Co-creator of Star Bandits -- a graphical Science Fiction multiplayer online game, in the style of "Trade Wars'.

This topic is closed to new replies.

Advertisement