Gorgon
Show / Hide Table of Contents

Struct GorgonTriangleVertex

A value that defines a vertex for a triangle draw using the DrawTriangle(in GorgonTriangleVertex, in GorgonTriangleVertex, in GorgonTriangleVertex, GorgonTexture2DView, RectangleF?, int, GorgonSamplerState, float) method.

Implements
IGorgonEquatableByRef<GorgonTriangleVertex>
IEquatable<GorgonTriangleVertex>
Inherited Members
ValueType.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
Namespace: Gorgon.Renderers
Assembly: Gorgon.Renderers.Gorgon2D.dll
Syntax
public readonly struct GorgonTriangleVertex : IGorgonEquatableByRef<GorgonTriangleVertex>, IEquatable<GorgonTriangleVertex>

Constructors

| Edit this page View Source

GorgonTriangleVertex(Vector2, GorgonColor, Vector2?, int)

Initializes a new instance of the GorgonTriangleVertex struct.

Declaration
public GorgonTriangleVertex(Vector2 position, GorgonColor color, Vector2? textureCoordinate = null, int textureArrayIndex = 0)
Parameters
Type Name Description
Vector2 position

The position of the triangle point.

GorgonColor color

The color of the triangle pint.

Vector2? textureCoordinate

[Optional] The texture coordinate to map to the point.

int textureArrayIndex

[Optional] The index in a texture array to map to the point.

Fields

| Edit this page View Source

Color

The color of the point.

Declaration
public readonly GorgonColor Color
Field Value
Type Description
GorgonColor
| Edit this page View Source

Position

The horizontal and vertical position of the point.

Declaration
public readonly Vector2 Position
Field Value
Type Description
Vector2
| Edit this page View Source

TextureArrayIndex

The texture array index to map to the point.

Declaration
public readonly int TextureArrayIndex
Field Value
Type Description
int
Remarks

If no texture is assigned to the triangle, or the texture is not a texture array, then this member is ignored.

| Edit this page View Source

TextureCoordinate

The texture coordinate, in texels, to map to the point.

Declaration
public readonly Vector2 TextureCoordinate
Field Value
Type Description
Vector2
Remarks

If no texture is assigned to the triangle, this member is ignored.

Methods

| Edit this page View Source

Equals(GorgonTriangleVertex)

Indicates whether the current object is equal to another object of the same type.

Declaration
public bool Equals(GorgonTriangleVertex other)
Parameters
Type Name Description
GorgonTriangleVertex other

An object to compare with this object.

Returns
Type Description
bool

true if the current object is equal to the other parameter; otherwise, false.

| Edit this page View Source

Equals(in GorgonTriangleVertex)

Function to compare this instance with another.

Declaration
public bool Equals(in GorgonTriangleVertex other)
Parameters
Type Name Description
GorgonTriangleVertex other

The other instance to use for comparison.

Returns
Type Description
bool

true if equal, false if not.

| Edit this page View Source

Equals(in GorgonTriangleVertex, in GorgonTriangleVertex)

Function to compare two points for equality.

Declaration
public static bool Equals(in GorgonTriangleVertex left, in GorgonTriangleVertex right)
Parameters
Type Name Description
GorgonTriangleVertex left

The left point to compare.

GorgonTriangleVertex right

The right point to compare.

Returns
Type Description
bool

true if the points are equal, false if not.

| Edit this page View Source

Equals(object)

Indicates whether this instance and a specified object are equal.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj

The object to compare with the current instance.

Returns
Type Description
bool

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

Overrides
ValueType.Equals(object)
| Edit this page View Source

GetHashCode()

Returns the hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
int

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

Overrides
ValueType.GetHashCode()

Operators

| Edit this page View Source

operator ==(in GorgonTriangleVertex, in GorgonTriangleVertex)

Operator to determine if two instances are equal.

Declaration
public static bool operator ==(in GorgonTriangleVertex left, in GorgonTriangleVertex right)
Parameters
Type Name Description
GorgonTriangleVertex left

The left instance to compare.

GorgonTriangleVertex right

The right instance to compare.

Returns
Type Description
bool

true if both instances are equal, false if not.

| Edit this page View Source

operator !=(in GorgonTriangleVertex, in GorgonTriangleVertex)

Operator to determine if two instances are not equal.

Declaration
public static bool operator !=(in GorgonTriangleVertex left, in GorgonTriangleVertex right)
Parameters
Type Name Description
GorgonTriangleVertex left

The left instance to compare.

GorgonTriangleVertex right

The right instance to compare.

Returns
Type Description
bool

true if both instances are not equal, false if equal.

Implements

IGorgonEquatableByRef<T>
IEquatable<T>

Extension Methods

GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • 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