有谁知道 DirectX 中是否有获取 LPDIRECT3DTEXTURE9 尺寸的函数?我只需要宽度和高度。如果没有,有人知道实现此目的的快速而肮脏的方法吗?
最佳答案
LPDIRECT3DTEXTURE
可能包含 multiple images of different sizes .你必须指定你想要哪一个。通常,0 是原始大小,其他是用于优化 GPU 性能的 mipmap。
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;
关于c++ - 在 Direct X 9.0c 中获取 LPDIRECT3DTEXTURE9 的尺寸?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2905624/