fork(136) download
  1. //Jeff Chastine
  2. #include <Windows.h>
  3. #include <GL\glew.h>
  4. #include <GL\freeglut.h>
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. void changeViewPort(int w, int h)
  10. {
  11. glViewport(0, 0, w, h);
  12. }
  13.  
  14. void render()
  15. {
  16. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  17. glutSwapBuffers();
  18. }
  19.  
  20.  
  21.  
  22. int main(int argc, char* argv[]) {
  23.  
  24. // Initialize GLUT
  25. glutInit(&argc, argv);
  26. // Set up some memory buffers for our display
  27. glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
  28. // Set the window size
  29. glutInitWindowSize(800, 600);
  30. // Create the window with the title "Hello,GL"
  31. glutCreateWindow("Hello, GL");
  32. // Bind the two functions (above) to respond when necessary
  33. glutReshapeFunc(changeViewPort);
  34. glutDisplayFunc(render);
  35.  
  36. // Very important! This initializes the entry points in the OpenGL driver so we can
  37. // call all the functions in the API.
  38. GLenum err = glewInit();
  39. if (GLEW_OK != err) {
  40. fprintf(stderr, "GLEW error");
  41. return 1;
  42. }
  43.  
  44.  
  45. glutMainLoop();
  46. return 0;
  47. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:10: fatal error: Windows.h: No such file or directory
 #include <Windows.h>
          ^~~~~~~~~~~
compilation terminated.
stdout
Standard output is empty