开发者

Getting the Dimensions of an LPDIRECT3DTEXTURE9 in Direct X 9.0c?

Does anyone know if there is a function in DirectX to get the dimensions of an LPDIRECT3D开发者_StackOverflowTEXTURE9? I just need the width and height. If there isn't, anyone know of a quick and dirty way to accomplish this?


LPDIRECT3DTEXTURE's may contain multiple images of different sizes. You'll have to specify which one you want. Usually, 0 is the original size, others are mipmaps that used for optimizing performance on GPU.

D3DSURFACE_DESC surfaceDesc;
int level = 0; //The level to get the width/height of (probably 0 if unsure)
myTexture->GetLevelDesc(level, &surfaceDesc); 
size_t size = surfaceDesc.Width * surfaceDesc.Height;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜