Jump to content
  • Advertisement
Sign in to follow this  
dronbas

How to get the size of a texture?

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

I need to get width and height of a texture.How can I manage this? A simple texture that is loaded with D3DXCreateTextureFromFile. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
IDirect3DTexture9 has a method called GetLevelDesc which returns a surface description (D3DSURFACE_DESC). The surface description has Width and Height members. To get the width and height of your texture, pass 0 as the Level parameter to GetLevelDesc.

For more info, look here

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!