Guest User

Untitled

a guest
Jan 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. #include <GL/glew.h>
  2. #include <GL/freeglut.h>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, char **argv) {
  8. // initialize GLUT
  9. glutInitContextVersion(4,1);
  10. glutInitContextFlags(GLUT_FORWARD_COMPATIBLE);
  11. glutInitContextProfile(GLUT_CORE_PROFILE);
  12. glutInit(&argc, argv);
  13. glutInitWindowSize(800,600);
  14. glutCreateWindow("Testing OpenGL 4.1...");
  15.  
  16. // initialize GLEW
  17. GLenum GlewInitResult;
  18. glewExperimental = GL_TRUE;
  19. GlewInitResult = glewInit();
  20.  
  21. if(GLEW_OK != GlewInitResult) {
  22. cerr << "Error: " << glewGetErrorString(GlewInitResult) << endl;
  23. exit(EXIT_FAILURE);
  24. }
  25.  
  26. // display system information
  27.  
  28. cout << "GLEW Version " << glewGetString(GLEW_VERSION) << endl
  29. << "Vendor: " << glGetString(GL_VENDOR) << endl
  30. << "Renderer: " << glGetString(GL_RENDERER) << endl
  31. << "OpenGL Version: " << glGetString (GL_VERSION) << endl
  32. << "GLSL Version: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << endl;
  33.  
  34. GLint nExtensions;
  35. glGetIntegerv(GL_NUM_EXTENSIONS, &nExtensions);
  36. cout << "Number of Extensions: " << nExtensions << endl
  37. << "\nExtensions loaded..." << endl;
  38. for( int i = 0; i < nExtensions; i++ ) {
  39. cout << glGetStringi(GL_EXTENSIONS, i) << endl;
  40. }
  41. glutMainLoop();
  42. return 0;
  43. }
Add Comment
Please, Sign In to add comment