Skip to content

Instantly share code, notes, and snippets.

@skyfe79
Created June 24, 2012 03:46
Show Gist options
  • Save skyfe79/2981473 to your computer and use it in GitHub Desktop.
Save skyfe79/2981473 to your computer and use it in GitHub Desktop.
GLUT01-2
#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