Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public static VertexAttribPointerType BaseType(Attribute.AType type)
 {
     return((type == Attribute.AType.UBYTE4) ? VertexAttribPointerType.UnsignedByte : VertexAttribPointerType.Float);
 }