Guest User

Untitled

a guest
May 29th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <windows.h>
  2. #include <freeglut.h>
  3.  
  4. void renderFunction()
  5. {
  6.     glClear(GL_COLOR_BUFFER_BIT);
  7.     glColor3f(0.0f, 0.0f, 1.0f);
  8.     glBegin(GL_POLYGON);
  9.     glVertex3f(0.0, 0.0, 0.0);
  10.     glVertex3f(0.5, 0.0, 0.0);
  11.     glVertex3f(0.5, 0.5, 0.0);
  12.     glVertex3f(0.0, 0.5, 0.0);
  13.     glEnd();
  14.     glFlush();
  15. }
  16.  
  17. int main(int argc, char **argv)
  18. {
  19.     glutInit(&argc, argv);
  20.     glutInitDisplayMode(GLUT_SINGLE);
  21.     glutInitWindowSize(300, 300);
  22.     glutInitWindowPosition(100, 100);
  23.     glutCreateWindow("Hello world");
  24.     glutDisplayFunc(renderFunction);
  25.     glutMainLoop();
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment