CUSTOMVERTEX vertices[] = { { -1.0f, -1.0f, 0.0f, 0xffffffff }, { 1.0f, -1.0f, 0.0f, 0xffffffff }, { 0.0f, 1.0f, 0.0f, 0xffffffff } }; g_pD3DDevice->SetFVF(D3DFVF_CUSTOMVERTEX); g_pD3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);
CUSTOMVERTEX vertices[] = { { 0.0f, 0.0f, 0.0f, 0xff0000ff }, { 1.0f, 0.0f, 0.0f, 0xff0000ff } }; g_pD3DDevice->SetFVF(D3DFVF_CUSTOMVERTEX); g_pD3DDevice->DrawPrimitive(D3DPT_LINELIST, 0, 1);In both examples, the SetFVF function is used to set the Flexible Vertex Format. The DrawPrimitive function is then called with the appropriate parameters to specify the type of primitive to draw and the number of primitives to draw.