gpt4 book ai didi

c++ - 在 Direct X 9.0c 中获取 LPDIRECT3DTEXTURE9 的尺寸?

转载 作者:行者123 更新时间:2023-11-28 08:29:13 25 4
gpt4 key购买 nike

有谁知道 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com