![]() |
![]() |
![]() |
PrimitiveType Enumeration |
Language: |
Defines the primitives supported by Microsoft® Direct3D®.
Visual Basic .NET Public Enum PrimitiveType C# public enum PrimitiveType Managed C++ __value public enum PrimitiveType JScript .NET public enum PrimitiveType
Using Triangle Strips or Triangle Fans is often more efficient than using Triangle Lists because fewer vertices are duplicated.
Generate a Scene
This example shows how to begin scene generation and draw primitives.
The SetStreamSource method binds a vertex buffer to a device data stream to create an association between the vertex data and one of several data stream ports that feed the primitive processing functions. The parameters for this method are the number of the data stream, the name of the VertexBuffer object, and the stream vertex stride.
In the following C# code example, it is assumed that the device is the rendering Device, and vBuffer is a vertex buffer filled with CustomVertex.PositionNormal data.
[C#]
device.BeginScene(); device.SetStreamSource(0, vBuffer, 0); device.VertexFormat = CustomVertex.PositionNormal.Format; device.DrawPrimitives(PrimitiveType.TriangleList, 0, 1); device.EndScene();
Namespace Microsoft.DirectX.Direct3D Assembly Microsoft.DirectX.Direct3D (microsoft.directx.direct3d.dll) Strong Name Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center