s&box docs

public class Sandbox.VertexBuffer

Constructors

Showing 1 constructors

Methods

Showing 7 methods

public void Add(Sandbox.Vertex v)

Add a vertex

public void AddIndex(int i)

Add an index. This is relative to the top of the vertex buffer. So 0 is Vertex.Count., 1 is Vertex.Count -1

Exceptions

ExceptionCondition
InvalidOperationExceptionThrown when `Sandbox.VertexBuffer.Indexed` is false.

public void AddRawIndex(int i)

Add an index. This is NOT relative to the top of the vertex buffer.

Exceptions

ExceptionCondition
InvalidOperationExceptionThrown when `Sandbox.VertexBuffer.Indexed` is false.

public void AddTriangleIndex(int a, int b, int c)

Add a triangle by indices. This is relative to the top of the vertex buffer. So 0 is Vertex.Count.

Exceptions

ExceptionCondition
InvalidOperationExceptionThrown when `Sandbox.VertexBuffer.Indexed` is false.

public virtual void Clear()

Clear all vertices and indices, and resets `Sandbox.VertexBuffer.Default`.

public void Draw(Sandbox.Material material, Sandbox.RenderAttributes attributes = null)

Draw this mesh using Material

Parameters

  • attributes: Default: null

public virtual void Init(bool useIndexBuffer)

Clear the buffer and set whether it will have indices.

Parameters

  • useIndexBuffer: Whether this buffer will have indices. Affects `Sandbox.VertexBuffer.Indexed`.

Properties

Showing 1 properties

public bool Sandbox.VertexBuffer.Indexed { get; set; }

Whether this vertex buffer has any indexes. This is set by `Sandbox.VertexBuffer.Init(System.Boolean)`.

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.VertexBuffer

On this page