Skip to content

GraphicsAPI reference

Struct Vertex2D

Namespace: MicroEngine.Graphics.Devices
Assembly: MicroEngine.Graphics.dll
Guide: The graphics device

The vertex of the built-in pipeline (Textured), 32 bytes: position in target pixels relative to the viewport origin (y down), texture coordinate normalised to 0..1 over the bound texture, premultiplied colour that multiplies the texel. The layout is fixed and identical on every tier: Vertex2D.

C#
public readonly struct Vertex2D : IEquatable<Vertex2D>

Implements

IEquatable<Vertex2D>

Constructors

Vertex2D(Vector2, Vector2, ColorF)

The vertex of the built-in pipeline (Textured), 32 bytes: position in target pixels relative to the viewport origin (y down), texture coordinate normalised to 0..1 over the bound texture, premultiplied colour that multiplies the texel. The layout is fixed and identical on every tier: Vertex2D.

C#
public Vertex2D(Vector2 Position, Vector2 TexCoord, ColorF Color)

Parameters

Position Vector2

Pixels, relative to the viewport origin, y down. Pixel (x, y) has its centre at (x + 0.5, y + 0.5).

TexCoord Vector2

Normalised texture coordinate; (0, 0) is the top-left corner of texel (0, 0).

Color ColorF

Premultiplied colour multiplied with the sampled texel.

Fields

SizeInBytes

Size of one vertex in bytes (the stride of every built-in vertex buffer).

C#
public const int SizeInBytes = 32

Field Value

int

Properties

Color

Premultiplied colour multiplied with the sampled texel.

C#
public ColorF Color { get; init; }

Property Value

ColorF

Position

Pixels, relative to the viewport origin, y down. Pixel (x, y) has its centre at (x + 0.5, y + 0.5).

C#
public Vector2 Position { get; init; }

Property Value

Vector2

TexCoord

Normalised texture coordinate; (0, 0) is the top-left corner of texel (0, 0).

C#
public Vector2 TexCoord { get; init; }

Property Value

Vector2

Methods

Deconstruct(out Vector2, out Vector2, out ColorF)

C#
public void Deconstruct(out Vector2 Position, out Vector2 TexCoord, out ColorF Color)

Parameters

Position Vector2

TexCoord Vector2

Color ColorF

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(Vertex2D)

C#
public bool Equals(Vertex2D other)

Parameters

other Vertex2D

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(Vertex2D, Vertex2D)

C#
public static bool operator ==(Vertex2D left, Vertex2D right)

Parameters

left Vertex2D

right Vertex2D

Returns

bool

operator !=(Vertex2D, Vertex2D)

C#
public static bool operator !=(Vertex2D left, Vertex2D right)

Parameters

left Vertex2D

right Vertex2D

Returns

bool