void draw_poly(const Poly &poly, int gl_type, int linewidth, int pointsize, const float *rgb, float a, bool randomized) { glColor4f(rgb[0],rgb[1],rgb[2],a); glLineWidth(linewidth); glPointSize(pointsize); poly.draw(gl_type, randomized); }
void draw_poly(Poly poly, int gl_type, int linewidth, int pointsize, float r, float g, float b, float a) { glColor4f(r,g,b,a); glLineWidth(linewidth); glPointSize(pointsize); poly.draw(gl_type); }
/*---------------------------------------------------------------------------------------- * This is the main display callback function. It sets up the drawing for * The 3D scene first then calls the Draw3D() function. After that it switches to * an orthographic projection and calls Draw2D(). */ void Draw(void) { /* * Clear the background */ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); /* * Allow drawing in full region of the screen */ glViewport(0,0,winw,winh); glPushMatrix(); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); gluOrtho2D(0, winw, 0, winh); poly.Shrink(40); glLineWidth(1); poly.draw(Vector2f(0,0)); glLineWidth(3); poly.handleShrinkErrors(); poly.draw(Vector2f(640,0)); glPopMatrix(); glPopMatrix(); glMatrixMode(GL_MODELVIEW); /* * Bring the back buffer to the front and vice-versa. */ glutSwapBuffers(); }