示例#1
0
        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}."),
            });
示例#2
0
 private void Add(string name, VertexLayoutAttributeType type, int components)
 {
     _attributes.Add(new VertexLayoutAttribute(name, type, components));
 }
示例#3
0
 public VertexLayoutAttribute(string name, VertexLayoutAttributeType attributeType, int componentsCount)
 {
     Name            = name;
     AttributeType   = attributeType;
     ComponentsCount = componentsCount;
 }