Jump to content
  • Advertisement
Sign in to follow this  
Asheh

Managed DirectX - TextureLoader.FromFile auto-scales?

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

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]

Share this post


Link to post
Share on other sites
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.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!