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(); }
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(); }
public void attrib_pointer(int index, Attribtype type, int stride, int offset) => attrib_pointer(index, type, false, stride, offset);
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);