Dashboard/Quik/VertexGenerator/QuikVertex.cs

37 lines
1.0 KiB
C#

using System.Diagnostics;
namespace Quik.VertexGenerator
{
/// <summary>
/// Represents a GPU vertex.
/// </summary>
[DebuggerDisplay("XY={Position} RGBA={Color}, UV={TextureCoordinates}")]
public struct QuikVertex
{
/// <summary>
/// Position value.
/// </summary>
public QVec2 Position;
/// <summary>
/// Texture Coordinates.
/// </summary>
public QVec2 TextureCoordinates;
/// <summary>
/// Per vertex color value.
/// </summary>
public QColor Color;
/// <summary>
/// Per vertex depth index value.
/// </summary>
public int ZIndex;
public static int PositionOffset => 0;
public static unsafe int TextureCoordinatesOffset => sizeof(QVec2);
public static unsafe int ColorOffset => 2 * sizeof(QVec2);
public static unsafe int ZIndexOffset => ColorOffset + sizeof(QColor);
public static unsafe int Stride => sizeof(QuikVertex);
}
}