fork download
  1. #include <windows.h>
  2. #include <GL/glut.h>
  3. void draw(void)
  4. {
  5. glClear(GL_COLOR_BUFFER_BIT); // Clear display window
  6. glBegin(GL_QUADS); // start drawing
  7. glColor3f(1, 0, 0); // set the drawing color to red
  8. glVertex2i(25, 25);
  9. glVertex2i(375, 25);
  10. glVertex2i(375, 375);
  11. glVertex2i(25, 375);
  12. glEnd(); // end drawing
  13. glFlush(); // send any buffered output to the OpenGL rendering process
  14. }
  15. void main()
  16. {
  17. glutInitWindowSize(400,400); // Set display window width and height
  18. glutInitDisplayMode(GLUT_RGB);
  19. glutCreateWindow("OpenGL Set Up Test"); // Create display window
  20. glOrtho(-100.0, 500.0, -100.0, 500.0, 0.0, 1.0);
  21. glClearColor(1.0, 1.0, 1.0, 1.0);
  22. glutDisplayFunc(draw); // Send graphics to display window
  23. glutMainLoop(); // Display everything and wait
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:10: fatal error: windows.h: No such file or directory
 #include <windows.h>
          ^~~~~~~~~~~
compilation terminated.
stdout
Standard output is empty