Advertisement
Guest User

Untitled

a guest
Sep 18th, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <GL/glut.h>
  2.  
  3. void
  4. reshape(int w, int h)
  5. {
  6. glViewport(0, 0, w, h);
  7. glMatrixMode(GL_PROJECTION);
  8. glLoadIdentity();
  9. glOrtho(0, w, 0, h, -1, 1);
  10. }
  11.  
  12. void
  13. display(void)
  14. {
  15. glClear(GL_COLOR_BUFFER_BIT);
  16. glBegin(GL_POINTS);
  17. for (int i = 0; i<399; ++i)
  18. {
  19. glVertex2i(i, (i*i)%399);
  20. }
  21. glEnd();
  22. glFlush();
  23. }
  24.  
  25. int
  26. main(int argc, char **argv)
  27. {
  28. glutInit(&argc, argv);
  29. glutCreateWindow("some points");
  30. glutDisplayFunc(display);
  31. glutReshapeFunc(reshape);
  32. glutMainLoop();
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement