vertex struct
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;
vertex data
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);
My question is
The rect’s size should be 20×100(width x height) pixels, but in display is 20×97(width x height) pixels.Why?Thanks.
the problem has been solved.
the backbuffer size dose not matching the window size, ignore the window’s frame, so the backbuffer surface be scaled in window, and the display’s pixel size is not correct.