Advertisement
Guest User

Untitled

a guest
Apr 13th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <GL/freeglut.h>
  2. #include <GL/gl.h>
  3.  
  4.  
  5. void renderFunction()
  6. {
  7. glClearColor(0.0, 0.0, 0.0, 0.0);
  8. glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0, 1.0, 1.0); glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); glBegin(GL_POLYGON); glVertex2f(-0.5, -0.5); glVertex2f(-0.5, 0.5); glVertex2f(0.5, 0.5); glVertex2f(0.5, -0.5); glEnd(); glFlush();
  9.  
  10. }
  11. int main(int argc, char** argv)
  12. {
  13. glutInit(&argc, argv);
  14. glutInitDisplayMode(GLUT_SINGLE); glutInitWindowSize(500,500); glutInitWindowPosition(100,100);
  15. glutCreateWindow("OpenGL - First window demo"); glutDisplayFunc(renderFunction);
  16. glutMainLoop(); return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement