2022-08-16 20:35:12 +02:00
|
|
|
using System.Diagnostics;
|
2022-08-04 15:40:58 +02:00
|
|
|
|
|
|
|
namespace Quik.VertexGenerator
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Represents a GPU vertex.
|
|
|
|
/// </summary>
|
2022-08-16 20:35:12 +02:00
|
|
|
[DebuggerDisplay("XY={Position} RGBA={Color}, UV={TextureCoordinates}")]
|
2022-08-04 15:40:58 +02:00
|
|
|
public struct QuikVertex
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Position value.
|
|
|
|
/// </summary>
|
2023-06-29 09:42:02 +02:00
|
|
|
public QVec2 Position;
|
2022-08-04 15:40:58 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Texture Coordinates.
|
|
|
|
/// </summary>
|
2023-06-29 09:42:02 +02:00
|
|
|
public QVec2 TextureCoordinates;
|
2023-06-23 21:56:07 +02:00
|
|
|
|
2022-08-04 15:40:58 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Per vertex color value.
|
|
|
|
/// </summary>
|
2023-06-29 09:42:02 +02:00
|
|
|
public QColor Color;
|
2022-08-04 15:40:58 +02:00
|
|
|
|
2023-06-23 21:56:07 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Per vertex depth index value.
|
|
|
|
/// </summary>
|
|
|
|
public int ZIndex;
|
|
|
|
|
2022-08-04 15:40:58 +02:00
|
|
|
public static int PositionOffset => 0;
|
2023-06-29 09:42:02 +02:00
|
|
|
public static unsafe int TextureCoordinatesOffset => sizeof(QVec2);
|
|
|
|
public static unsafe int ColorOffset => 2 * sizeof(QVec2);
|
|
|
|
public static unsafe int ZIndexOffset => ColorOffset + sizeof(QColor);
|
2022-08-04 15:40:58 +02:00
|
|
|
public static unsafe int Stride => sizeof(QuikVertex);
|
|
|
|
}
|
|
|
|
}
|