Jump to content
  • Advertisement
Sign in to follow this  
lo1989

D3DXCreateTextureFromFileEx

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

IF i load textures non power of 2 dimensions, how can i determine the real dimensions of the loaded texture? i know i can compute the next power of 2 but how can i determine from the texture-object what dimensions it has?

Share this post


Link to post
Share on other sites
Advertisement
HRESULT WINAPI D3DXCreateTextureFromFileEx(
LPDIRECT3DDEVICE9 pDevice,
LPCTSTR pSrcFile,
UINT Width,
UINT Height,
UINT MipLevels,
DWORD Usage,
D3DFORMAT Format,
D3DPOOL Pool,
DWORD Filter,
DWORD MipFilter,
D3DCOLOR ColorKey,
D3DXIMAGE_INFO *pSrcInfo,
PALETTEENTRY *pPalette,
LPDIRECT3DTEXTURE9 *ppTexture
);

if you send a D3DXIMAGE_INFO structure, you'll get the width and height of the texture..

Share this post


Link to post
Share on other sites
that gives me only info about the orig file on hd. but maybe the texture was stretched to powerof2 in dimensions, and how can i determine that?

Share this post


Link to post
Share on other sites
Try getting a D3DSURFACE_DESC from your texture surface level 0:
texture.GetLevelDesc(0,surf_desc_structure).

It gives absolutely proper result about the in-memory dimensions of the texture for me.


HTH

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!