193194195196197198199200201202203
// otherwise draw a polygon else gl.glBegin(GL2.GL_TRIANGLE_FAN); /* For best performance here */ for (final Point vertex : hole) gl.glVertex2f(vertex.x, vertex.y); gl.glEnd(); } /* Finally draw all of the circular holes */
267268269270271272273274275276277
// otherwise draw a polygon else gl.glBegin(GL2.GL_POLYGON); for (final Point vertex : polygon.vertices()) gl.glVertex2f(vertex.x, vertex.y); gl.glEnd(); // pop current color gl.glPopAttrib();
184185186187188189190191192193194
// the inside is red gl.glColor3f(1.0f, 0.0f, 0.0f); else // the outside is gray gl.glColor3f(0.0f, 0.0f, 0.0f); gl.glVertex2f(x, y); } } gl.glEnd(); // pop the current color gl.glPopAttrib();