Gorgon
Show / Hide Table of Contents

Struct GorgonVertexBufferBinding

A binding state for a GorgonVertexBuffer.

Implements
IGorgonEquatableByRef<GorgonVertexBufferBinding>
IEquatable<GorgonVertexBufferBinding>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
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 Source

GorgonVertexBufferBinding(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
GorgonVertexBuffer

Fields

| Edit this page View Source

Empty

Empty vertex buffer binding.

Declaration
public static readonly GorgonVertexBufferBinding Empty
Field Value
Type Description
GorgonVertexBufferBinding
See Also
GorgonVertexBuffer
| Edit this page View Source

Offset

Offset within the buffer to start at, in bytes.

Declaration
public readonly int Offset
Field Value
Type Description
int
See Also
GorgonVertexBuffer
| Edit this page View Source

Stride

Stride of the items within the vertex buffer, in bytes.

Declaration
public readonly int Stride
Field Value
Type Description
int
See Also
GorgonVertexBuffer
| Edit this page View Source

VertexBuffer

The vertex buffer to bind.

Declaration
public readonly GorgonVertexBuffer VertexBuffer
Field Value
Type Description
GorgonVertexBuffer
See Also
GorgonVertexBuffer

Methods

| Edit this page View Source

CreateVertexBuffer<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 graphics, or the info parameter is null.

See Also
GorgonVertexBuffer
| Edit this page View Source

Equals(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
GorgonVertexBuffer
| Edit this page View Source

Equals(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
GorgonVertexBuffer
| Edit this page View Source

Equals(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
GorgonVertexBuffer
| Edit this page View Source

Equals(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
ValueType.Equals(object)
See Also
GorgonVertexBuffer
| Edit this page View Source

GetHashCode()

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
ValueType.GetHashCode()
See Also
GorgonVertexBuffer
| Edit this page View Source

ToString()

Returns a string that represents this instance.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents this instance.

Overrides
ValueType.ToString()
See Also
GorgonVertexBuffer

Operators

| Edit this page View Source

operator ==(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
GorgonVertexBuffer
| Edit this page View Source

operator !=(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
GorgonVertexBuffer

Implements

IGorgonEquatableByRef<T>
IEquatable<T>

Extension Methods

GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)

See Also

GorgonVertexBuffer
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author