Files
doom-dm/Engine/Renderer/Buffer/Vertex/VertexAttribute.cs
2024-12-04 22:35:04 +03:00

26 lines
789 B
C#

using OpenTK.Graphics.OpenGL;
namespace Engine.Renderer.Buffer.Vertex;
[AttributeUsage(AttributeTargets.Field)]
public class VertexAttribute : Attribute
{
public VertexAttribType Type { get; }
public int ComponentCount { get; }
public bool Normalized { get; }
public int RepeatCount { get; }
public VertexAttribute(VertexAttribType type, int componentCount = 1, bool normalized = false, int repeatCount = 1)
{
if (componentCount <= 0)
throw new ArgumentException("Count must be greater than 0");
if (repeatCount <= 0)
throw new ArgumentException("Repeat must be greater than 0");
Type = type;
ComponentCount = componentCount;
Normalized = normalized;
RepeatCount = repeatCount;
}
}