/*To draw a triangle we need three vertices with each vertex having 2-coordinates [x, y] and a color for the triangle. * This function takes 4 arguments first three arguments (3 vertices + 1 color) to * draw the triangle with the given color. * */ void DrawTriangle(int x1, int y1, int x2, int y2, int x3, int y3, float color[]) { glColor3fv(color); // Set the triangle colour // ask library to draw triangle at given position... glBegin(GL_TRIANGLES); /*Draw triangle using given three vertices...*/ glVertex4i(x1, y1, 0, 1); glVertex4i(x2, y2, 0, 1); glVertex4i(x3, y3, 0, 1); glEnd(); }
template< > inline void glVertex4< int > ( int x,int y,int z, int w ) { glVertex4i(x,y,z,w); };
M(void, glVertex4i, jint x, jint y, jint z, jint w) { glVertex4i(x, y, z, w); }
inline void glVertex(Vector3i const &v, int const &z) { glVertex4i(v.c[0], v.c[1], v.c[2], z); }
///////////////////////////////////////////////////////// // Render // void GEMglVertex4i :: render(GemState *state) { glVertex4i (x, y, z, w); }