Nerfed/Nerfed.Runtime/Gui/GuiStructs.cs

33 lines
860 B
C#
Raw Permalink Normal View History

2024-07-10 21:50:04 +02:00
using Nerfed.Runtime.Graphics;
using System.Numerics;
using System.Runtime.InteropServices;
namespace Nerfed.Runtime.Gui;
[StructLayout(LayoutKind.Sequential)]
public struct Position2DTextureColorVertex(Vector2 position, Vector2 texcoord, Color color) : IVertexType
{
public Vector2 Position = position;
public Vector2 TexCoord = texcoord;
public Color Color = color;
public static VertexElementFormat[] Formats { get; } = new VertexElementFormat[3]
{
VertexElementFormat.Vector2,
VertexElementFormat.Vector2,
VertexElementFormat.Color
};
public static uint[] Offsets { get; } = new uint[3]
{
0,
8,
16
};
}
[StructLayout(LayoutKind.Sequential)]
public struct TransformVertexUniform(Matrix4x4 projectionMatrix)
{
public Matrix4x4 ProjectionMatrix = projectionMatrix;
}