Skip to content

Instantly share code, notes, and snippets.

@acdimalev
Created September 13, 2012 08:39
Show Gist options
  • Save acdimalev/3712927 to your computer and use it in GitHub Desktop.
Save acdimalev/3712927 to your computer and use it in GitHub Desktop.
// gcc foo.c $(pkg-config --cflags --libs glew gl) -lglut
#include <GL/glew.h>
#include <GL/glut.h>
void display() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutSolidSphere(1, 8, 8);
glutSwapBuffers();
}
int main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
glutInitWindowSize(320, 180);
glutCreateWindow("title");
glewInit();
glEnable(GL_DEPTH_TEST);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment