title: Commenting out glfwWindowHint() makes code functional (OpenGL with GLFW), why?
body: <p>sorry I had a bit of trouble with the proper name for this question, however I've run into a roadblock and I'd like to at least be informed as to the source. </p>
  
  <p>I've been trying to learn to learn openGL and I'm following this tutorial:
  <a href="http://open.gl" rel="nofollow">open.gl</a></p>
  
  <p><strong>Lines in question:</strong></p>
  
  <pre><code>glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
  glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
  glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
  glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
  </code></pre>
  
  <p>While following through the tutorial I got an access violation exception in my code. Only after I commented out the following lines was I able to get the program working as the tutorial says it should have worked the first time. The tutorial states the following about the commented out lines:</p>
  
  <p>"You'll immediately notice the first three lines of code that are only relevant for this library. It is specified that we require the OpenGL context to support OpenGL 3.2 at the least. The GLFW_OPENGL_PROFILE option specifies that we want a context that only supports the new core functionality."</p>
  
  <p>My thought was that perhaps my drivers do not support OpenGL 3.2 or higher since when I commented out the <strong>lines in question</strong> my program ran fine. <em>However</em>, I downloaded a software called GPU caps viewer. When the software scanned my hardware it said that both my NVIDIA GeForce GT 540M and HD Graphics 3000 support OpenGL 4.3. So I'm very confused as to the source of my problem, <strong>what I am doing wrong, or is this a hardware issue?</strong></p>
  
  <p>Here are snapshots of GPU CAPS and NVIDIA PORTAL: <a href="http://imgur.com/U7S8Khh&amp;MTKwgKT" rel="nofollow">2 pictures on imgur</a></p>
  
  <p><strong>Doesn't Work:</strong></p>
  
  <pre><code>#include "stdafx.h"  //necessary headers in here
  
  
  int _tmain(int argc, _TCHAR* argv[])
  {
  glfwInit();
  
  glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
  glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
  glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
  glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
  glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
  
  GLFWwindow* window = glfwCreateWindow(800, 600, "OpenGL", nullptr, nullptr); // Windowed
  glfwMakeContextCurrent(window);
  
  while (!glfwWindowShouldClose(window))
  {
      glfwSwapBuffers(window);
      glfwPollEvents();
      if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
          glfwSetWindowShouldClose(window, GL_TRUE);
  }
  glfwTerminate();
  return 0;
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Works:</strong></p>
  
  <pre><code>#include "stdafx.h" //necessary headers in here
  
  
  int _tmain(int argc, _TCHAR* argv[])
  {
  glfwInit();
  /**
  glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
  glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
  glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
  glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
  glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
  **/
  GLFWwindow* window = glfwCreateWindow(800, 600, "OpenGL", nullptr, nullptr); // Windowed
  glfwMakeContextCurrent(window);
  
  while (!glfwWindowShouldClose(window))
  {
      glfwSwapBuffers(window);
      glfwPollEvents();
      if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
          glfwSetWindowShouldClose(window, GL_TRUE);
  }
  glfwTerminate();
  return 0;
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Header File</strong></p>
  
  <pre><code>#pragma once
  #define GLEW_STATIC
  #include &lt;glew.h&gt;
  
  #include "targetver.h"
  
  #include &lt;stdio.h&gt;
  #include &lt;tchar.h&gt;
  #include &lt;iostream&gt;
  #include &lt;thread&gt;
  
  #define GLFW_INCLUDE_GLU
  #include &lt;glfw3.h&gt;
  </code></pre>
  
  <p>One last thing that came to mind, when I go to my NVIDIA control panel it shows Visual Studio 2013 only as using Intel HD 3000 graphics card. It doesn't give me an option to use my GeForce graphics with it, could this be the issue?</p>
  
  <p><strong>EditOne:</strong> 
  I tried running my Visual Studio 2013 through windows explorer by right clicking on it and choosing "Run with graphics processor..." but to no avail. </p>
  
  <p>I appreciate you looking through my question to help me solve it, and if you had this question yourself I hope it helped you solve your issue. </p>