ait-survey

very simple opengl viewer

Dec 26th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <GL/glut.h>
  2. //Drawing funciton
  3. void draw(void)
  4. {
  5. //Background color
  6.     glClearColor(0,1,0,1);
  7.     glClear(GL_COLOR_BUFFER_BIT );
  8. //Draw order
  9.     glFlush();
  10. }
  11. //Main program
  12. int main(int argc, char **argv)
  13. {
  14.     glutInit(&argc, argv);
  15. //Simple buffer
  16.     glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB );
  17.     glutInitWindowPosition(50,25);
  18.     glutInitWindowSize(500,250);
  19.     glutCreateWindow("Green window");
  20. //Call to the drawing function
  21.     glutDisplayFunc(draw);
  22.     glutMainLoop();
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment