title: Why am I not getting a forward compatible OpenGL context with GLFW?
body: <p>To my knowledge, when I set these context constraints on GLFW:</p>
  
  <pre><code>glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
  glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
  glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
  glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
  </code></pre>
  
  <p>I should get the maximum available OpenGL context on the running machine, provided that it's above OpenGL 3.3. However, by using <code>glGetString</code> to get the OpenGL context version, I am finding that this is not the case. Everytime I query <code>glGetString</code> for the context version, I only get the major and minor versions I set with <code>glfwWindowHint</code>, nothing above. Keep in mind, my GPU supports OpenGL 4.5.</p>
  
  <p>Another thing to note, when I set no constraints whatsoever, I do in fact get an OpenGL 4.5 context.</p>
  
  <p>Here is the full source code, which seems to replicate the problem:</p>
  
  <pre><code>#define GLEW_STATIC
  
  #include &lt;iostream&gt;
  
  #include &lt;GL\glew.h&gt;
  #include &lt;GLFW\glfw3.h&gt;
  #include &lt;glm\glm.hpp&gt;
  
  int main(int argc, char argv[])
  {
  
      if (!glfwInit())
      {
          std::cerr  &lt;&lt; "Failed to initialize GLFW 3.0.4" &lt;&lt; std::endl;
          getchar();
  
          glfwTerminate();
          return -1;
      }
  
      std::cout &lt;&lt; "Initialized GLFW 3.0.4" &lt;&lt; std::endl;
  
      glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
      glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
      glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
      glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
  
      GLFWwindow* m_window = glfwCreateWindow(640, 480, "Koala", NULL, NULL);
  
      if (!m_window)
      {
          std::cerr  &lt;&lt; "Failed to create OpenGL 3.3+ context" &lt;&lt; std::endl;
          getchar();
          glfwTerminate();
          return -1;
      }
  
      glfwMakeContextCurrent(m_window);
  
      std::cout &lt;&lt; "Created OpenGL 3.3+ context" &lt;&lt; std::endl;
  
      glewExperimental = GL_TRUE;
  
      if (glewInit() != GLEW_OK)
      {
          std::cerr &lt;&lt; "Failed to initialize GLEW 1.11.0" &lt;&lt; std::endl;
          getchar();
          glfwTerminate();
          return -1;
      }
  
      std::cout &lt;&lt; "Initialized GLEW 1.11.0" &lt;&lt; std::endl;
  
      const GLubyte* renderer = glGetString(GL_RENDERER);
      const GLubyte* version = glGetString(GL_VERSION);
  
      std::cout &lt;&lt; "GPU: " &lt;&lt; renderer &lt;&lt; std::endl;
      std::cout &lt;&lt; "OpenGL Version: " &lt;&lt; version &lt;&lt; std::endl;
  
      while (!glfwWindowShouldClose(m_window))
      {
          glfwSwapBuffers(m_window);
          glfwPollEvents();
      }
  
      glfwTerminate();
      return 0;
  
  }
  </code></pre>