Advertisement
Guest User

ayxan

a guest
Feb 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. #include <GL/glut.h>
  2. void myDisplay()
  3. {
  4. glClearColor(0,0,0,1);
  5. glClear(GL_COLOR_BUFFER_BIT);
  6.  
  7.  
  8. glBegin(GL_LINES); //(x y)
  9. glColor3f(0.82,0.27,0.45);
  10. glVertex2f(0,0);
  11. glVertex2f(-5,0);
  12. glEnd();
  13.  
  14. glBegin(GL_LINES); //(x y)
  15. glColor3f(0.19,0.22,0.33);
  16. glVertex2f(0,0);
  17. glVertex2f(5,0);
  18. glEnd();
  19.  
  20. glBegin(GL_LINES); //(x y)
  21. glColor3f(0.77,0.88,0.99);
  22. glVertex2f(0,0);
  23. glVertex2f(0,-5);
  24. glEnd();
  25.  
  26. glBegin(GL_LINES); //(x y)
  27. glColor3f(0.44,0.55,0.66);
  28. glVertex2f(0,0);
  29. glVertex2f(0,5);
  30. glEnd();
  31.  
  32. glBegin(GL_LINES); //(x y)
  33. glColor3f(0.13,0.25,0.36);
  34. glVertex2f(-0.3,0);
  35. glVertex2f(0,0.3);
  36. glEnd();
  37.  
  38. glBegin(GL_LINES); //(x y)
  39. glColor3f(0.7,0.8,0.9);
  40. glVertex2f(0,-0.3);
  41. glVertex2f(0.3,0);
  42. glEnd();
  43.  
  44. glBegin(GL_LINES); //(x y)
  45. glColor3f(0.4,0.5,0.6);
  46. glVertex2f(0,0.3);
  47. glVertex2f(0.3,0);
  48. glEnd();
  49.  
  50. glBegin(GL_LINES); //(x y)
  51. glColor3f(0.1,0.2,0.3);
  52. glVertex2f(-0.3,0);
  53. glVertex2f(0,-0.3);
  54. glEnd();
  55.  
  56. glutSwapBuffers();
  57. }
  58.  
  59. int main (int* argc, char** argv)
  60. {
  61. glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
  62. glutInitWindowSize(500,500);
  63. glutInitWindowPosition(0,0);
  64. glutCreateWindow("First Open Gl");
  65. glutDisplayFunc(myDisplay);
  66. glutMainLoop();
  67. return 0;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement