|
// 自定义顶点结构
struct CUSTOMVERTEX
{
FLOAT x, y, z, rhw; // 经过坐标转换的顶点坐标
DWORD color; // 顶点漫反射颜色值
};
// Our custom FVF, which describes our custom vertex structure
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE)
CUSTOMVERTEX g_Vertices[] =
{
{ 0.0f,0.0f, 0.5f, 1.0f, 0xff00ffff, }, //红色
{ 0.0f,50.0f,0.5f, 1.0f, 0xff00ffff, }, //蓝色
{ 50.0f,0.0f,0.5f, 1.0f, 0xff00ffff, }, //绿色
};
//D3DPT_POINTLIST
// Create the vertex buffer. Here we are allocating enough memory
// (from the default pool) to hold all our 3 custom vertices. We also
// specify the FVF, so the vertex buffer knows what data it contains.
if( FAILED( g_pd3dDevice->CreateVertexBuffer(sizeof(g_Vertices),
0, D3DFVF_CUSTOMVERTEX,
D3DPOOL_DEFAULT, &g_pVB,NULL ) ) )
{
return E_FAIL;
}
我怎么RENDER的时候怎么什么也看不到。。。。。。。。。。。。。。
why ?????????
[em1] [em5] |
|