DirectX9 IDirect3DDevice9::DrawPrimitive

来源:互联网 发布:试戴墨镜软件 编辑:程序博客网 时间:2024/06/04 19:19

IDirect3DDevice9::DrawPrimitive

This method is used to draw primitives that do not use index info.

HRESULT IDirect3DDevice9::DrawPrimitive(
D3DPRIMITIVETYPE PrimitiveType,
UINT StartVertex,
UINT PrimitiveCount
);


PrimitiveType—The type of primitive that we are drawing. For instance, we can draw points and lines in addition to triangles. Since we are using a triangle, useD3DPT_TRIANGLELISTfor this parameter.

StartVertex—Index to an element in the vertex streams that marks the starting point from which to begin reading vertices. This parameter gives us the flexibility to only draw certain portions of a vertex buffer.

PrimitiveCount—The number of primitives to draw


Example:
// draw four triangles.
_device->DrawPrimitive( D3DPT_TRIANGLELIST, 0, 4);


0 0
原创粉丝点击