Sample code
Sample code
*/
/* Global variables */
void initGL() {
glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set background color to black and opaque
/* Handler for window-repaint event. Called back when the window first appears and
void display() {
// Front
// Right
// Back
// Left
glColor3f(1.0f,0.0f,0.0f); // Red
glColor3f(0.0f,0.0f,1.0f); // Blue
glVertex3f(-1.0f,-1.0f,-1.0f);
glColor3f(0.0f,1.0f,0.0f); // Green
glVertex3f(-1.0f,-1.0f, 1.0f);
anglePyramid += 0.2f;
angleCube -= 0.15f;
/* Handler for window re-size event. Called back when the window first appears and
whenever the window is re-sized with its new width and height */
// Set the aspect ratio of the clipping volume to match the viewport
glLoadIdentity(); // Reset
return 0;