public int TypeSizeInBytes(Attribute.AType type) { int size = 0; switch (type) { case Attribute.AType.FLOAT: { size = sizeof(float); break; } case Attribute.AType.VECTOR2: { size = Vector2.SizeInBytes; break; } case Attribute.AType.VECTOR3: { size = Vector3.SizeInBytes; break; } case Attribute.AType.VECTOR4: { size = Vector4.SizeInBytes; break; } } return(size); }
public static int NumberOfFloatsInType(Attribute.AType type) { int size = 0; switch (type) { case Attribute.AType.FLOAT: { size = 1; break; } case Attribute.AType.VECTOR2: { size = 2; break; } case Attribute.AType.VECTOR3: { size = 3; break; } case Attribute.AType.VECTOR4: { size = 4; break; } } return(size); }
public static VertexAttribPointerType BaseType(Attribute.AType type) { return((type == Attribute.AType.UBYTE4) ? VertexAttribPointerType.UnsignedByte : VertexAttribPointerType.Float); }