Sign in to follow this  
lo1989

D3DXCreateTextureFromFileEx

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
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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this