Look at this very basic C++ code:
if(!glfwInit())
{
return -1;
}
glfwWindowHint(GLFW_SAMPLES, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
window = glfwCreateWindow(640, 480, "Test", NULL, NULL);
if (window==NULL)
{
return -1;
}
glfwMakeContextCurrent(window);
std::cout << "GL_VERSION: " << glGetString(GL_VERSION) << std::endl;
I do not understand how i can "detect" max opengl version i can set in the lines:
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
This line cannot be placed before glfwMakeContextCurrent:
glGetString(GL_VERSION)
So my question is how can i detect the versions of opengl my system supports at the beginning of the program.
Thanks