本文整理汇总了C#中PrimitiveType.GetPrimitiveCount方法的典型用法代码示例。如果您正苦于以下问题:C# PrimitiveType.GetPrimitiveCount方法的具体用法?C# PrimitiveType.GetPrimitiveCount怎么用?C# PrimitiveType.GetPrimitiveCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PrimitiveType
的用法示例。
在下文中一共展示了PrimitiveType.GetPrimitiveCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Geometry
/// <summary>
/// Create a Geometry object.
/// </summary>
/// <param name="device">The graphics device to create the geometry on.</param>
/// <param name="primitiveType">The type of primitive used to draw the geometry.</param>
/// <param name="vertices">The vertices of the geometry.</param>
public Geometry(GraphicsDevice device, PrimitiveType primitiveType, IVertices vertices)
{
XiHelper.ArgumentNullCheck(device, vertices);
this.device = device;
this.primitiveType = primitiveType;
vertexSize = vertices.VertexSize;
vertexCount = vertices.Length;
vertexBuffer = new VertexBuffer(device, vertices.Length * vertices.VertexSize, BufferUsage.None);
vertices.SetDataOfVertexBuffer(vertexBuffer);
primitiveCount = primitiveType.GetPrimitiveCount(vertices.Length);
vertexDeclaration = new ManagedVertexDeclaration(device, vertices.VertexElements);
}