Table of Contents

Class ElementsBufferModel<T>

Namespace
HelixToolkit.SharpDX.Core
Assembly
HelixToolkit.SharpDX.dll

Used for managing instance buffer update

public class ElementsBufferModel<T> : DisposeObject, IElementsBufferModel<T>, IElementsBufferModel, IVertexExtraBufferModel, IGUID, IDisposable where T : unmanaged

Type Parameters

T
Inheritance
ElementsBufferModel<T>
Implements
Derived
Inherited Members

Constructors

ElementsBufferModel(int)

public ElementsBufferModel(int structSize)

Parameters

structSize int

Fields

Empty

public static readonly ElementsBufferModel<T> Empty

Field Value

ElementsBufferModel<T>

Properties

Buffer

Gets the buffer.

public IElementsBufferProxy? Buffer { get; }

Property Value

IElementsBufferProxy

The buffer.

Changed

Gets a value indicating whether this IVertexExtraBufferModel is changed.

public bool Changed { get; }

Property Value

bool

true if changed; otherwise, false.

ElementCount

Gets the element count.

public int ElementCount { get; }

Property Value

int

The element count.

Elements

Gets or sets the elements.

public IList<T>? Elements { get; set; }

Property Value

IList<T>

The elements.

GUID

Gets the unique identifier.

public Guid GUID { get; }

Property Value

Guid

The unique identifier.

HasElements

Gets a value indicating whether this instance has elements.

public bool HasElements { get; }

Property Value

bool

true if this instance has elements; otherwise, false.

Initialized

Gets a value indicating whether this IVertexExtraBufferModel is initialized.

public bool Initialized { get; }

Property Value

bool

true if initialized; otherwise, false.

StructSize

public int StructSize { get; }

Property Value

int

Methods

AttachBuffer(DeviceContextProxy, ref int)

Attaches the buffer.

public virtual void AttachBuffer(DeviceContextProxy context, ref int vertexBufferStartSlot)

Parameters

context DeviceContextProxy

The context.

vertexBufferStartSlot int

The vertex buffer slot. Returns the next available slot after binding

DisposeAndClear()

Disposes internal buffer and reuse the object

public void DisposeAndClear()

Initialize()

Initializes this instance.

public void Initialize()

OnDispose(bool)

Disposes of object resources.

protected override void OnDispose(bool disposeManagedResources)

Parameters

disposeManagedResources bool

If true, managed resources should be disposed of in addition to unmanaged resources.

Events

ElementChanged

Occurs when [on element changed].

public event EventHandler<EventArgs>? ElementChanged

Event Type

EventHandler<EventArgs>