title: Glew's glewIsSupported("GL_VERSION_3_1") returning false on MBP OSX 10.10.1 with NVIDIA GeForce GT 650M
body: <p>I am trying to run a program which requires OpenGL 3.1 on my Macbook Pro Retina from mid 2012 running OSX 10.10.1 with NVIDIA GeForce GT 650M. I installed Glew through Homebrew and running <code>glewinfo</code> shows the following:</p>
  
  <pre><code>GL_VERSION_3_1:                                              OK 
  ---------------
  glDrawArraysInstanced:                                       OK
  glDrawElementsInstanced:                                     OK
  glPrimitiveRestartIndex:                                     OK
  glTexBuffer:                                                 OK
  </code></pre>
  
  <p>However, when the line <code>glewIsSupported("GL_VERSION_3_1")</code> in the code I'm running returns false. I searched online and found something about X Server on OSX supporting only up to OpenGL 2.1 and thought that this could be the problem.</p>
  
  <p>So I also downloaded <a href="http://www.realtech-vr.com/glview/" rel="nofollow">GLView</a> and noticed that when I switch from Core to Compatibility the OpenGL version goes down from 4.1 to 2.1. I suppose this means that <code>glewIsSupported("GL_VERSION_3_1")</code> checks for the compatibility version and not the core. If I change that check to <code>GL_VERSION_2_1</code> are there any risks for my graphics card or my computer in general? Is there a way to know if the code requires core or compatibility? And if it does require X Server, is there a way to get X Server to use OpenGL 3.1? </p>
  
  <p>[EDIT: These are the headers.]</p>
  
  <pre><code>...
  #include &lt;GL/glew.h&gt;
  
  #ifdef __linux__
  #include &lt;pthread.h&gt;
  #include &lt;sys/time.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  #endif
  
  #ifdef __APPLE__
  #include &lt;sys/time.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;GLUT/glut.h&gt;
  #else
  #include &lt;GL/glut.h&gt;
  #endif
  </code></pre>