Ejemplo n.º 1
0
        private static VertexAttribPointerType get_attrib_type(Attribtype type)
        {
            switch (type)
            {
            case Attribtype.Float:
            case Attribtype.Vec2:
            case Attribtype.Vec3:
                return(VertexAttribPointerType.Float);

            case Attribtype.Double:
            case Attribtype.DVec2:
            case Attribtype.DVec3:
                return(VertexAttribPointerType.Double);

            case Attribtype.Int:
            case Attribtype.IVec2:
            case Attribtype.IVec3:
                return(VertexAttribPointerType.Int);
            }
            throw new Exception();
        }
Ejemplo n.º 2
0
        private static int get_attrib_size(Attribtype type)
        {
            switch (type)
            {
            case Attribtype.Float:
            case Attribtype.Double:
            case Attribtype.Int:
                return(1);

            case Attribtype.Vec2:
            case Attribtype.DVec2:
            case Attribtype.IVec2:
                return(2);

            case Attribtype.Vec3:
            case Attribtype.DVec3:
            case Attribtype.IVec3:
                return(3);
            }
            throw new Exception();
        }
Ejemplo n.º 3
0
 public void attrib_pointer(int index, Attribtype type, int stride, int offset) => attrib_pointer(index, type, false, stride, offset);
Ejemplo n.º 4
0
 public void attrib_pointer(int index, Attribtype type, bool normalized, int stride, int offset) => attrib_pointer(index, get_attrib_size(type), get_attrib_type(type), normalized, stride, offset);