26 lines
789 B
C#
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;
|
|
}
|
|
} |