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);
本文介绍了IDirect3DDevice9::DrawPrimitive方法的基本用法,该方法用于在Direct3D中绘制未使用索引信息的原始图形。文章详细解释了三个参数的作用:原始类型、起始顶点和原始计数,并通过示例展示了如何使用此方法来绘制四个三角形。

950

被折叠的 条评论
为什么被折叠?



