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
structSizeint
Fields
Empty
public static readonly ElementsBufferModel<T> Empty
Field Value
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
trueif 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
trueif this instance has elements; otherwise,false.
Initialized
Gets a value indicating whether this IVertexExtraBufferModel is initialized.
public bool Initialized { get; }
Property Value
- bool
trueif initialized; otherwise,false.
StructSize
public int StructSize { get; }
Property Value
Methods
AttachBuffer(DeviceContextProxy, ref int)
Attaches the buffer.
public virtual void AttachBuffer(DeviceContextProxy context, ref int vertexBufferStartSlot)
Parameters
contextDeviceContextProxyThe context.
vertexBufferStartSlotintThe 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
disposeManagedResourcesboolIf true, managed resources should be disposed of in addition to unmanaged resources.
Events
ElementChanged
Occurs when [on element changed].
public event EventHandler<EventArgs>? ElementChanged