在 XNA 中,你可以这样做
texture = new Texture2D( GraphicsDevice, width, height ) ;
我猜在 MSFT 内部深处的某个地方,这相当于 C++ 代码:
D3DXCreateTexture( GraphicsDevice, width, height, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture ) ;
在 XNA 中,有一个漂亮的函数可以让您设置您创建的纹理的像素值:
texture.SetData<Color>( new Color[]{ pixel, values, pixel, values ) ;
现在我非常确定一定有一个 C++ DirectX 等价物。有人知道这是什么吗?
最佳答案
关于c# - IDirect3DTexture9::设置数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2293923/