Created
June 24, 2012 03:46
-
-
Save skyfe79/2981473 to your computer and use it in GitHub Desktop.
GLUT01-2
This file contains 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 <OpenGL/OpenGL.h> | |
#include <GLUT/GLUT.h> | |
void renderScene(void) | |
{ | |
glClear(GL_COLOR_BUFFER_BIT); | |
glFlush(); | |
} | |
void setupRenderingContext(void) | |
{ | |
glClearColor(0.0, 0.0, 0.0, 1.0f); | |
} | |
int main(int argc, const char * argv[]) | |
{ | |
glutInit(&argc, const_cast<char **>(argv)); | |
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); | |
glutCreateWindow("Hello GLUT"); | |
glutDisplayFunc(renderScene); | |
setupRenderingContext(); | |
glutMainLoop(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment