Slide 19
Slide 19 text
Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 18
jgs
Programming
void init (void) {
//set display-window color to white.
glClearColor(1.0, 1.0, 1.0, 0.0);
// Set projection parameters.
glMatrixMode (GL_PROJECTION);
gluOrtho2D (0.0, 200.0, 0.0, 150.0);
}
void lineSegment (void) {
// Clear display window.
glClear (GL_COLOR_BUFFER_BIT);
// Set line segment color to red.
glColor3f (0.0, 0.0, 1.0);
glBegin (GL_LINES);
// Specify line-segment geometry.
glVertex2i (180, 15);
glVertex2i (10, 145);
glEnd ( );
// Process all OpenGL routines as quickly as possible.
glFlush ( );
}