顶点结构
struct Vertex
{
float x, y, z;
float rhw;
D3DCOLOR diffuse;
float u, v;
Vertex(){}
Vertex(float px, float py, D3DCOLOR pdiffuse, float pu, float pv)
{
x = px; y = py; z = 0.0f;
rhw = 1.0f;
diffuse = pdiffuse;
u = pu; v = pv;
}
static const DWORD FVF;
};
const DWORD Vertex::FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1;
顶点数据
lpVbData[0] = Vertex(0.0f, 0.0f, 0xFF000000, 0.0f, 0.0f);
lpVbData[1] = Vertex(20.0f, 0.0f, 0xFF000000, 1.0f, 0.0f);
lpVbData[2] = Vertex(20.0f, 100.0f, 0xFF000000, 1.0f, 1.0f);
lpVbData[3] = Vertex(0.0f, 100.0f, 0xFF000000, 0.0f, 1.0f);
我的问题是 rect的大小应为20x100(宽x高)像素,但显示的是20x97(宽x高)像素。为什么?谢谢。
答案 0 :(得分:0)