本文整理汇总了C#中VertexBuffer.SetUseCount方法的典型用法代码示例。如果您正苦于以下问题:C# VertexBuffer.SetUseCount方法的具体用法?C# VertexBuffer.SetUseCount怎么用?C# VertexBuffer.SetUseCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VertexBuffer
的用法示例。
在下文中一共展示了VertexBuffer.SetUseCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VertexBufferArray
internal VertexBufferArray(string name, int id, VertexBufferLayoutKind[] vblk, VertexBuffer vb, IndexBuffer ib = null) : base(name, id, GraphicsResourceType.VertexBufferArray)
{
_LayoutElements = new List<VertexBufferLayoutKind[]>();
_InternalBuffers = new List<VertexBuffer>();
VertexBufferLayoutKind[] layout = new VertexBufferLayoutKind[vblk.Length];
Array.Copy(vblk, layout, layout.Length);
_LayoutElements.Add(layout);
_InternalBuffers.Add(vb);
vb.SetUseCount(vb.InternalUseCount + 1);
_InternalOptionalIndexBuffer = ib;
if(ib != null)
_InternalOptionalIndexBuffer.SetUseCount(_InternalOptionalIndexBuffer.InternalUseCount + 1);
}
示例2: AddVertexBuffer
public void AddVertexBuffer(VertexBufferLayoutKind[] vblk, VertexBuffer vb)
{
if (!m_PrepareMode)
{
GL.BindVertexArray(ID);
}
if (vb.Created)
{
GL.BindBuffer(BufferTarget.ArrayBuffer, vb.ID);
for (int i = 0; i < vblk.Length; i++)
{
GL.EnableVertexAttribArray(vblk[i].AttributeID);
GL.VertexAttribPointer(vblk[i].AttributeID, vblk[i].AttributeSize, (VertexAttribPointerType)vblk[i].AttributeType,
vblk[i].Normalized, vblk[i].Stride, (IntPtr)vblk[i].Offset);
}
VertexBufferLayoutKind[] layout = new VertexBufferLayoutKind[vblk.Length];
Array.Copy(vblk, layout, layout.Length);
_LayoutElements.Add(layout);
_InternalBuffers.Add(vb);
vb.SetUseCount(vb.InternalUseCount + 1);
}
if(!m_PrepareMode)
{
GL.BindVertexArray(0);
}
}