see
Created
January 31, 2018 15:35
-
-
Save tamakiii/8e1af32c5c99588a78c44f31912c2f01 to your computer and use it in GitHub Desktop.
OpenGL Animation with Double Buffering
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 <GLUT/GLUT.h> | |
void display(void) { | |
glClear(GL_COLOR_BUFFER_BIT); | |
glRotatef(1, 0, 0, 1); | |
glutWireTeapot(1); | |
glutSwapBuffers(); | |
} | |
void idle(void) { | |
glutPostRedisplay(); | |
} | |
int main(int argc, char *argv[]) | |
{ | |
glutInit(&argc, argv); | |
glutInitWindowPosition(640, 0); | |
glutInitWindowSize(640, 640); | |
glutCreateWindow("Title"); | |
glClearColor(0, 0, 0, 1.0f); | |
glutDisplayFunc(display); | |
glutIdleFunc(idle); | |
glutMainLoop(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment