DirectX SDK |
This section pertains only to application development in Visual Basic. See Direct3D Immediate Mode C/C++ Tutorials.
The following Direct3DDevice7.DrawPrimitive call draws a wall segment composed of a D3DVERTEX type triangle strip:
Call g_d3dDevice.DrawPrimitive(D3DPT_TRIANGLESTRIP, D3DFVF_VERTEX, g_vWall(0), _ NUM_WALL_VERTICES, D3DDP_DEFAULT)
The following DrawPrimitive call draws a cone which is a triangle fan of custom, flexible vertices:
Call g_d3dDevice.DrawPrimitive(D3DPT_TRIANGLEFAN, D3DFVF_XYZ Or D3DFVF_NORMAL, g_vCone(0), _ NUM_CONE_VERTICES, D3DDP_DEFAULT)
Lastly, the following Direct3DDevice7.DrawIndexedPrimitive call draws a cube which is composed of application transformed and lit, indexed vertices:
Call g_d3dDevice.DrawIndexedPrimitive(D3DPT_TRIANGLELIST, D3DFVF_TLVERTEX, g_vCube(0), _ NUM_CUBE_VERTICES, g_nCubeIndices, NUM_CUBE_INDICES, D3DDP_DEFAULT)