VertexBufferclass

objectVertexBuffer
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public class Sandbox.VertexBuffer

Constructors1

Showing 1 constructors

Methods7

Showing 7 methods

public void Add(Sandbox.Vertex v)PUBLIC

Add a vertex

ParameterTypeDescription
vVertex
Returns:void

public void AddIndex(int i)PUBLIC

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

ParameterTypeDescription
iint
Returns:void

Exceptions

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

public void AddRawIndex(int i)PUBLIC

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

ParameterTypeDescription
iint
Returns:void

Exceptions

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

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

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

ParameterTypeDescription
aint
bint
cint
Returns:void

Exceptions

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

public virtual void Clear()PUBLICVIRTUAL

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

Returns:void

public virtual void Init(bool useIndexBuffer)PUBLICVIRTUAL

Clear the buffer and set whether it will have indices.

ParameterTypeDescription
useIndexBufferboolWhether this buffer will have indices. Affects `Sandbox.VertexBuffer.Indexed`.
Returns:void

Properties1

Showing 1 properties

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

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

Returns:bool

On this page