Struct GorgonVertexBufferBinding
A binding state for a GorgonVertexBuffer.
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public readonly struct GorgonVertexBufferBinding : IGorgonEquatableByRef<GorgonVertexBufferBinding>, IEquatable<GorgonVertexBufferBinding>
Remarks
This is used to bind a GorgonVertexBuffer to the GPU pipeline.
Constructors
| Edit this page View SourceGorgonVertexBufferBinding(GorgonVertexBuffer, int, int)
Initializes a new instance of the GorgonVertexBufferBinding struct.
Declaration
public GorgonVertexBufferBinding(GorgonVertexBuffer buffer, int stride, int offset = 0)
Parameters
Type | Name | Description |
---|---|---|
GorgonVertexBuffer | buffer | The buffer to bind. |
int | stride | The stride of the data in the buffer, in bytes. |
int | offset | [Optional] The offset within the buffer to start at, in bytes. |
See Also
Fields
| Edit this page View SourceEmpty
Empty vertex buffer binding.
Declaration
public static readonly GorgonVertexBufferBinding Empty
Field Value
Type | Description |
---|---|
GorgonVertexBufferBinding |
See Also
| Edit this page View SourceOffset
Offset within the buffer to start at, in bytes.
Declaration
public readonly int Offset
Field Value
Type | Description |
---|---|
int |
See Also
| Edit this page View SourceStride
Stride of the items within the vertex buffer, in bytes.
Declaration
public readonly int Stride
Field Value
Type | Description |
---|---|
int |
See Also
| Edit this page View SourceVertexBuffer
The vertex buffer to bind.
Declaration
public readonly GorgonVertexBuffer VertexBuffer
Field Value
Type | Description |
---|---|
GorgonVertexBuffer |
See Also
Methods
| Edit this page View SourceCreateVertexBuffer<T>(GorgonGraphics, GorgonVertexBufferInfo, ReadOnlySpan<T>, int)
Function to create a vertex buffer and its binding.
Declaration
public static GorgonVertexBufferBinding CreateVertexBuffer<T>(GorgonGraphics graphics, GorgonVertexBufferInfo info, ReadOnlySpan<T> initialData = default, int bindingIndex = 0) where T : unmanaged
Parameters
Type | Name | Description |
---|---|---|
GorgonGraphics | graphics | The graphics interface that will create the buffer. |
GorgonVertexBufferInfo | info | Information about the buffer to create. |
ReadOnlySpan<T> | initialData | [Optional] An initial set of vertex data to send to the buffer. |
int | bindingIndex | [Optional] The index, in vertices, inside the buffer where binding is to begin. |
Returns
Type | Description |
---|---|
GorgonVertexBufferBinding | A new GorgonVertexBufferBinding. |
Type Parameters
Name | Description |
---|---|
T | The type of data representing a vertex, must be an unmanaged value type. |
Remarks
Use this to quickly create a vertex buffer and its binding based on a known vertex data type.
Be aware that the VertexBuffer created by this method must be disposed manually after it is no longer of any use.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourceEquals(GorgonVertexBufferBinding)
Function to determine if two instances are equal.
Declaration
public bool Equals(GorgonVertexBufferBinding other)
Parameters
Type | Name | Description |
---|---|---|
GorgonVertexBufferBinding | other | The other instance. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
See Also
| Edit this page View SourceEquals(in GorgonVertexBufferBinding)
Function to compare this instance with another.
Declaration
public bool Equals(in GorgonVertexBufferBinding other)
Parameters
Type | Name | Description |
---|---|---|
GorgonVertexBufferBinding | other | The other instance to use for comparison. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
See Also
| Edit this page View SourceEquals(in GorgonVertexBufferBinding, in GorgonVertexBufferBinding)
Function to determine if two instances are equal.
Declaration
public static bool Equals(in GorgonVertexBufferBinding left, in GorgonVertexBufferBinding right)
Parameters
Type | Name | Description |
---|---|---|
GorgonVertexBufferBinding | left | The left instance to compare. |
GorgonVertexBufferBinding | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
See Also
| Edit this page View SourceEquals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool | true if the specified object is equal to this instance; otherwise, false. |
Overrides
See Also
| Edit this page View SourceGetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
See Also
| Edit this page View SourceToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents this instance. |
Overrides
See Also
Operators
| Edit this page View Sourceoperator ==(in GorgonVertexBufferBinding, in GorgonVertexBufferBinding)
Implements the operator ==.
Declaration
public static bool operator ==(in GorgonVertexBufferBinding left, in GorgonVertexBufferBinding right)
Parameters
Type | Name | Description |
---|---|---|
GorgonVertexBufferBinding | left | The left. |
GorgonVertexBufferBinding | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
See Also
| Edit this page View Sourceoperator !=(in GorgonVertexBufferBinding, in GorgonVertexBufferBinding)
Implements the operator ==.
Declaration
public static bool operator !=(in GorgonVertexBufferBinding left, in GorgonVertexBufferBinding right)
Parameters
Type | Name | Description |
---|---|---|
GorgonVertexBufferBinding | left | The left. |
GorgonVertexBufferBinding | right | The right. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |