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.
Inherited Members
Namespace: Gorgon.Renderers
Assembly: Gorgon.Renderers.Gorgon2D.dll
Syntax
public readonly struct GorgonTriangleVertex : IGorgonEquatableByRef<GorgonTriangleVertex>, IEquatable<GorgonTriangleVertex>
Constructors
| Edit this page View SourceGorgonTriangleVertex(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 SourceColor
The color of the point.
Declaration
public readonly GorgonColor Color
Field Value
Type | Description |
---|---|
GorgonColor |
Position
The horizontal and vertical position of the point.
Declaration
public readonly Vector2 Position
Field Value
Type | Description |
---|---|
Vector2 |
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.
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 SourceEquals(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 |
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. |
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. |
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 |
Overrides
| Edit this page View SourceGetHashCode()
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
Operators
| Edit this page View Sourceoperator ==(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. |
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. |