see
Created
February 1, 2018 13:18
-
-
Save tamakiii/c64c0176ad6380ba1dea50020cd03318 to your computer and use it in GitHub Desktop.
OpenGL timer
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 timer(int value) { | |
glutPostRedisplay(); | |
glutTimerFunc(1000/60, timer, 0); | |
} | |
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); | |
glutTimerFunc(0, timer, 0); | |
glutMainLoop(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment