OSX Mavericks
has no support of OpenGL 4.2
. Hence, it is impossible to create a 4.2 context. The last supported version is 4.1
+ some extensions which are made into Core in 4.2
.
If you want to ship today the only option is using OpenGL 4.1
with extensions.
Here is the code for GLFW3
:
glfwWindowHint( GLFW_CONTEXT_VERSION_MAJOR, 4 );
glfwWindowHint( GLFW_CONTEXT_VERSION_MINOR, 1 );
glfwWindowHint( GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE );
glfwWindowHint( GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE );