Skip to content

Instantly share code, notes, and snippets.

@wowotek
Created June 18, 2020 12:45
Show Gist options
  • Save wowotek/b18df7ab66b1cc5b5946c2aebd9dddd1 to your computer and use it in GitHub Desktop.
Save wowotek/b18df7ab66b1cc5b5946c2aebd9dddd1 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <gl/glut.h>
#include <math.h>
void
OnDisplayRender(void) {
glClear(GL_COLOR_BUFFER_BIT);
glPointSize(15);
glColor3f(0, 1, 1);
glFlush();
}
void
OnDisplayUpdate(int) {
glutPostRedisplay();
glutTimerFunc(7, OnDisplayUpdate, 1);
}
int main(int argc, char** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowPosition(480, 150);
glutInitWindowSize(800, 800);
glutCreateWindow(argv[0]);
gluOrtho2D(0, 100, 100, 0);
glClearColor(0.0, 0.0, 0.0, 0.0);
glutTimerFunc(7, OnDisplayUpdate, 1);
glutDisplayFunc(OnDisplayRender);
glutMainLoop();
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment