// Friendly.c // A Friendly OpenGL Program // OpenGL SuperBible, 2nd Edition // Richard S. Wright Jr. #include // Called to draw scene void RenderScene(void) { // Clear the window with current clearing color glClear(GL_COLOR_BUFFER_BIT); // Flush drawing commands glFlush(); } // Setup the rendering state void SetupRC(void) { // Set clear color to blue glClearColor(0.0f, 0.0f, 1.0f, 1.0f); } // Main program entry point int main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutCreateWindow("Simple"); glutDisplayFunc(RenderScene); SetupRC(); glutMainLoop(); return 0; }