UNIX Version (Windows Below)
| /*#####################################*/
/*Description: program to draw three red lines */ /* to a GLUT window that is 500x500 pixels */ /*Author: L. Grewe */ /*Date: 1-1-99 */ /*#####################################*/ #include <GL/gl.h>
#include <stdio.h>
/*Function prototypes*/
void main(int argc, char **argv)
/*there will be
a single buffered window displaying RGB */
glutInitWindowSize(500,500);
/*size in pixels */
/*Create the window
using the setup from the previous glut calls*/
/*tell system what
function will be in charge of displaying*/
/*Call another function
to further initialize window contents*/
/*this call causes
to go in infinite loop waiting for window i/o */
}
/*#####################################*/
/*white background
*/
/*drawing color
red */
/*Viewing Configuration
*/
/*#####################################*/
glClear(GL_COLOR_BUFFER_BIT);
/*clear screen*/
glFlush(); /*not needed but asks to draw ASAP.*/ }
|
Windows Version
| /*#####################################*/
/*Description: program to draw three red lines */ /* to a GLUT window that is 500x500 pixels */ /*Author: L. Grewe */ /*Date: 1-1-99 */ /*#####################################*/ #include <windows.h> #include <GL\Gl.h>
#include <stdio.h>
/*Function prototypes*/
void main(int argc, char **argv)
/*there will be
a single buffered window displaying RGB */
glutInitWindowSize(500,500);
/*size in pixels */
/*Create the window
using the setup from the previous glut calls*/
/*tell system what
function will be in charge of displaying*/
/*Call another function
to further initialize window contents*/
/*this call causes
to go in infinite loop waiting for window i/o */
}
/*#####################################*/
/*white background
*/
/*drawing color
red */
/*Viewing Configuration
*/
/*#####################################*/
glClear(GL_COLOR_BUFFER_BIT);
/*clear screen*/
glFlush(); /*not needed but asks to draw ASAP.*/ }
|