private static VertexAttribPointerType GetVertexPointerType(VertexLayoutAttributeType type) { return(type switch { VertexLayoutAttributeType.Byte => VertexAttribPointerType.Byte, VertexLayoutAttributeType.Int => VertexAttribPointerType.Int, VertexLayoutAttributeType.Short => VertexAttribPointerType.Short, VertexLayoutAttributeType.Float => VertexAttribPointerType.Float, VertexLayoutAttributeType.Double => VertexAttribPointerType.Double, VertexLayoutAttributeType.UnsignedByte => VertexAttribPointerType.UnsignedByte, VertexLayoutAttributeType.UnsignedInt => VertexAttribPointerType.UnsignedInt, VertexLayoutAttributeType.UnsignedShort => VertexAttribPointerType.UnsignedShort, _ => throw new NotImplementedException($"Unsupported AttributeType: {type}."), });
private void Add(string name, VertexLayoutAttributeType type, int components) { _attributes.Add(new VertexLayoutAttribute(name, type, components)); }
public VertexLayoutAttribute(string name, VertexLayoutAttributeType attributeType, int componentsCount) { Name = name; AttributeType = attributeType; ComponentsCount = componentsCount; }