Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // initialize GLEW so we can make OpenGL calls. Print an error and close the window if it fails
- GLenum err = glewInit();
- if(err != GLEW_OK)
- {
- fprintf(stderr, "Error initializing GLEW.\n");
- glfwTerminate();
- return -1;
- }
- // if we see the below log statements, we've successfully attached OpenGL to the window
- // query the openGL version
- int glVersion[2] = {-1, 1};
- glGetIntegerv(GL_MAJOR_VERSION, &glVersion[0]);
- glGetIntegerv(GL_MINOR_VERSION, &glVersion[1]);
- // on error, log filepath and line number
- gl_debug(__FILE__, __LINE__);
- // print some information about our version of OpenGL.
- printf("Using OpenGL: %d.%d\n", glVersion[0], glVersion[1]);
- printf("Renderer used: %s\n", glGetString(GL_RENDERER));
- printf("Shading Language: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment