Nerfed/Nerfed.Runtime/Gui/Structs.cs

49 lines
1.0 KiB
C#
Raw Normal View History

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