1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
void myGlutDisplay ()
{
Point *temp;
// Clear the frame buffer...
glClear( GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
glColor3fv (color);
float pointSize = 0;
glGetFloatv(GL_POINT_SIZE, &pointSize);
// myGlutDisplay results depending on the mode
glBegin (mode);
for (temp = ihm->head; temp != NULL; temp = temp->np)
glVertex2f (temp->x, temp->y);
glEnd ();
// Set the color of points to green
glColor3f (0.0,255.0,0.0);
// myGlutDisplay points
if (displayMachine)
glBegin (GL_POINTS);
for (temp = ihm->head; temp != NULL; temp = temp->np)
glVertex2f (temp->x, temp->y);
glEnd ();
// myGlutDisplay the number of a point
if (displayMachineNum)
for (temp = ihm->head; temp != NULL; temp = temp->np)
ihm->printw (temp->x - (world_width/ (6.0 * window_width)),
temp->y + (world_height/ window_height) * 15,
"%d", temp->point_num);
// Swap buffers
glutSwapBuffers ();
} |
Partager