// FirstOpenGL.cpp // NKU CSC 480 Spring 2006 Kirby // ------------------------------------------------------------------ // Your first OpenGL program. Draws the Utah teapot. // // Purpose: // - To test whether you have the glut files and compiler set up ok. // - To show the basic organization of a simple glut program. // ------------------------------------------------------------------ #include void display() // Called by glut whenever scene needs repainting. { glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) ; glutWireTeapot( 0.5 ) ; glutSwapBuffers() ; } int main( int argc, char** argv ) { // Initialize OpenGL. glutInit( &argc, argv ) ; glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH ) ; // Window attributes. glutInitWindowSize( 600, 600 ) ; glutInitWindowPosition( 100, 100 ) ; glutCreateWindow( "Caption Here" ) ; // Register display callback. glutDisplayFunc( display ) ; // Turn control over to event loop. glutMainLoop() ; return 0 ; }