33 lines
860 B
C#
33 lines
860 B
C#
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;
|
|
} |