Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GL/glew.h>
- #include <GL/freeglut.h>
- #include <iostream>
- using namespace std;
- int main(int argc, char **argv) {
- // initialize GLUT
- glutInitContextVersion(4,1);
- glutInitContextFlags(GLUT_FORWARD_COMPATIBLE);
- glutInitContextProfile(GLUT_CORE_PROFILE);
- glutInit(&argc, argv);
- glutInitWindowSize(800,600);
- glutCreateWindow("Testing OpenGL 4.1...");
- // initialize GLEW
- GLenum GlewInitResult;
- glewExperimental = GL_TRUE;
- GlewInitResult = glewInit();
- if(GLEW_OK != GlewInitResult) {
- cerr << "Error: " << glewGetErrorString(GlewInitResult) << endl;
- exit(EXIT_FAILURE);
- }
- // display system information
- cout << "GLEW Version " << glewGetString(GLEW_VERSION) << endl
- << "Vendor: " << glGetString(GL_VENDOR) << endl
- << "Renderer: " << glGetString(GL_RENDERER) << endl
- << "OpenGL Version: " << glGetString (GL_VERSION) << endl
- << "GLSL Version: " << glGetString(GL_SHADING_LANGUAGE_VERSION) << endl;
- GLint nExtensions;
- glGetIntegerv(GL_NUM_EXTENSIONS, &nExtensions);
- cout << "Number of Extensions: " << nExtensions << endl
- << "\nExtensions loaded..." << endl;
- for( int i = 0; i < nExtensions; i++ ) {
- cout << glGetStringi(GL_EXTENSIONS, i) << endl;
- }
- glutMainLoop();
- return 0;
- }
Add Comment
Please, Sign In to add comment