Created
June 5, 2012 17:25
-
-
Save vo/2876372 to your computer and use it in GitHub Desktop.
Simplest OpenGL Program ever
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GL/glut.h> | |
void draw(void) | |
{ | |
glClearColor(0,1,0,1); | |
glClear(GL_COLOR_BUFFER_BIT ); | |
glFlush(); | |
} | |
int main(int argc, char **argv) | |
{ | |
glutInit(&argc, argv); | |
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB ); | |
glutInitWindowPosition(50,25); | |
glutInitWindowSize(500,250); | |
glutCreateWindow("Green window"); | |
glutDisplayFunc(draw); | |
glutMainLoop(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment