Table of Contents

Class RenderInstanceContainer

Namespace
LibGFX.Graphics
Assembly
LibGFX.dll

Represents a container for render instances.

public class RenderInstanceContainer : IGraphicsResource
Inheritance
RenderInstanceContainer
Implements
Inherited Members

Constructors

RenderInstanceContainer()

Creates a new instance of the RenderInstanceContainer class.

public RenderInstanceContainer()

Properties

ExtraInstanceBuffer

The buffer for the extra instance data.

public int ExtraInstanceBuffer { get; set; }

Property Value

int

InstanceVAO

The Vertex Array Object (VAO) for the instance container.

public int InstanceVAO { get; set; }

Property Value

int

Instances

The list of render instances in the container.

public List<RenderInstance> Instances { get; set; }

Property Value

List<RenderInstance>

IsInitialized

Gets a value indicating whether the object has been initialized and is ready for use.

public bool IsInitialized { get; }

Property Value

bool

Mesh

The mesh associated with the instance container.

public Mesh Mesh { get; set; }

Property Value

Mesh

TransformInstanceBuffer

The buffer for the model matrix of the instances.

public int TransformInstanceBuffer { get; set; }

Property Value

int

UVInstanceBuffer

The buffer for the UV transform data of the instances.

public int UVInstanceBuffer { get; set; }

Property Value

int

Methods

AddInstance(Transform, bool)

Adds a new instance to the container.

public int AddInstance(Transform transform, bool visibility)

Parameters

transform Transform
visibility bool

Returns

int

Dispose(IRenderDevice)

Releases all resources used by the current instance and performs cleanup using the specified render device.

public void Dispose(IRenderDevice renderer)

Parameters

renderer IRenderDevice

The render device to use for releasing resources. Cannot be null.

FreeCPUResources()

Releases any CPU resources that are currently allocated by the component.

public void FreeCPUResources()

Remarks

Call this method when the component no longer needs to perform CPU-intensive operations to allow the system to reclaim resources. After calling this method, the component may not be able to perform certain operations until resources are reallocated.

GetInstancesBuffers()

Gets the model matrices and extra data for the instances in the container.

public (Matrix4[], Vector4[], Vector4[]) GetInstancesBuffers()

Returns

(Matrix4[], Vector4[], Vector4[])

Init(IRenderDevice)

Initializes the current instance using the specified render device.

public void Init(IRenderDevice renderer)

Parameters

renderer IRenderDevice

The render device to use for initialization. Cannot be null.