Table of Contents

Struct Vertex

Namespace
Sdl3Sharp.Video.Rendering
Assembly
Sdl3Sharp.dll

Represents a vertex structure

public readonly struct Vertex : IEquatable<Vertex>, ISpanFormattable, IFormattable, IEqualityOperators<Vertex, Vertex, bool>
Implements
Inherited Members

Constructors

Vertex(in Point<float>, in Color<float>, in Point<float>)

Represents a vertex structure

[SetsRequiredMembers]
public Vertex(in Point<float> position, in Color<float> color, in Point<float> texCoord)

Parameters

position Point<float>

The position of the vertex in Renderer coordinates

color Color<float>

The color of the vertex

texCoord Point<float>

The texture coordinate of the vertex, typically normalized to be in the range from 0 to 1

Properties

Color

Gets or initializes the color of the vertex

public required Color<float> Color { get; init; }

Property Value

Color<float>

The color of the vertex

Position

Gets or initializes the position of the vertex

public required Point<float> Position { get; init; }

Property Value

Point<float>

The position of the vertex in Renderer coordinates

TexCoord

Gets or initializes the texture coordinate of the vertex

public required Point<float> TexCoord { get; init; }

Property Value

Point<float>

The texture coordinate of the vertex, typically normalized to be in the range from 0 to 1

Methods

Deconstruct(out Point<float>, out Color<float>, out Point<float>)

Deconstructs the vertex into its position, color, and texture coordinate components

public void Deconstruct(out Point<float> position, out Color<float> color, out Point<float> texCoord)

Parameters

position Point<float>

The position of the vertex in Renderer coordinates

color Color<float>

The color of the vertex

texCoord Point<float>

The texture coordinate of the vertex, typically normalized to be in the range from 0 to 1

Equals(in Vertex)

public bool Equals(in Vertex other)

Parameters

other Vertex

Returns

bool

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

ToString(IFormatProvider?)

Formats the value of the current instance using the specified format.

public string ToString(IFormatProvider? formatProvider)

Parameters

formatProvider IFormatProvider

The provider to use to format the value.

-or-

A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.

Returns

string

The value of the current instance in the specified format.

ToString(string?)

Formats the value of the current instance using the specified format.

public string ToString(string? format)

Parameters

format string

The format to use.

-or-

A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.

Returns

string

The value of the current instance in the specified format.

ToString(string?, IFormatProvider?)

Formats the value of the current instance using the specified format.

public string ToString(string? format, IFormatProvider? formatProvider)

Parameters

format string

The format to use.

-or-

A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.

formatProvider IFormatProvider

The provider to use to format the value.

-or-

A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.

Returns

string

The value of the current instance in the specified format.

TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)

Tries to format the value of the current instance into the provided span of characters.

public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)

Parameters

destination Span<char>

The span in which to write this instance's value formatted as a span of characters.

charsWritten int

When this method returns, contains the number of characters that were written in destination.

format ReadOnlySpan<char>

A span containing the characters that represent a standard or custom format string that defines the acceptable format for destination.

provider IFormatProvider

An optional object that supplies culture-specific formatting information for destination.

Returns

bool

true if the formatting was successful; otherwise, false.

Operators

operator ==(in Vertex, in Vertex)

Compares two values to determine equality.

public static bool operator ==(in Vertex left, in Vertex right)

Parameters

left Vertex

The value to compare with right.

right Vertex

The value to compare with left.

Returns

bool

true if left is equal to right; otherwise, false.

operator !=(in Vertex, in Vertex)

Compares two values to determine inequality.

public static bool operator !=(in Vertex left, in Vertex right)

Parameters

left Vertex

The value to compare with right.

right Vertex

The value to compare with left.

Returns

bool

true if left is not equal to right; otherwise, false.