Slide 12
Slide 12 text
Javier Gonzalez-Sanchez | SER332 | Spring 2018 | 12
jgs
Example
/**
* https://github.com/javiergs/SER332/blob/master/Lecture05/main.c
*/
void myDisplay() {
glClear(GL_COLOR_BUFFER_BIT); // clear the window
glShadeModel(GL_FLAT); //SMOOTH or FLAT
glBegin(GL_POLYGON); // fill connected polygon
glColor3f(1.0f, 0.843f, 0.0f); glVertex2f(-0.7, 0.7);
glColor3f(1.0f, 1.0f, 1.0f); glVertex2f(0.6, 0.7);
glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(-0.7, -0.6);
glEnd();
glShadeModel(GL_SMOOTH); //SMOOTH or FLAT
glBegin(GL_POLYGON); // fill connected polygon
glColor3f(1.0f, 0.843f, 0.0f); glVertex2f(0.7, 0.6);
glColor3f(1.0f, 1.0f, 1.0f); glVertex2f(-0.6, -0.7);
glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(0.7, -0.7);
glEnd();
glFlush();
}