我试图在我的 DirectX 应用程序中将纹理寻址模式设置为边框颜色。根据this source 我所要做的就是:
call IDirect3DDevice7::SetTextureStageState and pass the texture stage identifier as the first argument, the D3DTSS_BORDERCOLOR stage state value as the second argument, and the desired RGBA border color as the third argument
我尝试使用以下代码:
m_device->SetTextureStageState(0, D3DTSS_BORDERCOLOR, 0);
但是我得到一个编译错误说
identifier "D3DTSS_BORDERCOLOR" is undefined
最佳答案
您确定要使用 DirectX7 吗?
你的文档太旧了,那是针对现在已经过时的DirectX7的,你应该在DirectX9中使用下面的函数
m_device->SetSamplerState(0, D3DSAMP_BORDERCOLOR, 0xffff0000) // red color
更新:
如果您没有设置正确的地址模式,这里是边界模式的代码。
m_device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_BORDER);
m_device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_BORDER);
关于c++ - 在 DirectX9 中将纹理寻址模式设置为边框颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24184831/