Advertisement
Guest User

Untitled

a guest
Jun 14th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1.  
  2. #include <gl/glut.h>
  3. void display()
  4. {
  5. glClearColor(0,0,0,0);
  6. glClear(GL_COLOR_BUFFER_BIT);
  7. glColor3f(1,0,0);
  8. //Set point size to 3 pixels
  9. glPointSize(3);
  10. glBegin(GL_POINTS);
  11. glVertex2i(10,10);
  12. glVertex2i(20,10);
  13. glVertex2i(25,15);
  14. glVertex2i(20,20);
  15. glVertex2i(10,20);
  16. glEnd();
  17. glFlush();
  18. }
  19. int main(int argc, char** argv)
  20. {
  21. glutInit(&argc,argv);
  22. glutInitWindowPosition(50,50);
  23. glutInitWindowSize(640,480);
  24. glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
  25. glutCreateWindow("A sample OpenGL application");
  26. glMatrixMode(GL_PROJECTION);
  27. gluOrtho2D(0,50,0,50);
  28. glutDisplayFunc(display);
  29. glutMainLoop();
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement