anonymous wrote on Wednesday, October 24, 2012:
Release 2.7.6 64-bit… Now this is pretty strange…
I recently added those OpenWindowHint() calls:
glfw.OpenWindowHint(glfw.OpenGLVersionMajor, 3)
glfw.OpenWindowHint(glfw.OpenGLVersionMinor, 2)
glfw.OpenWindowHint(glfw.OpenGLProfile, glfw.OpenGLCoreProfile)
glfw.OpenWindowHint(glfw.OpenGLForwardCompat, 1)
On an Intel GPU (HD Graphics 4000 with May 2012 driver supporting GL 3.3 /
GLSL 330) OpenWindow() fails and returns 0 (tested with hints for 3.3 as
well). BUT *without* these hints, however, GLFW creates a proper core-
profile, version 3.3 context!
On an nVidia GPU (GeForce GT 640M LE with a recent driver supporting GL 4.2 /
GLSL 420), OpenWindow() creates a proper core-profile, but version 3.2
context. Without hints, a core-profile, version 4.2 context.
Now, the GLFW reference.pdf states: The GLFW_OPENGL_VERSION_MAJOR and
GLFW_OPENGL_VERSION_MINOR hints specify the OpenGL version that the created
context must be compatible with, not the exact version to use. It is therefore
perfectly safe to use the default of version 1.1 for legacy code and you will
still get backwards-compatible contexts of version 3.0 and above when
available. So as per this, it would be highly desirable if I could get a 4.2
context here even if 3.3 is specified as the desired minimum. How can this be
achieved?
Now, you might wonder - why should I even bother with these hints if the
system seems to automatically select the perfect context without any hints?
Mac OS X is the main reason. I have an MBP with a GeForce 330M and some
integrated graphics chip, OpenGL Monitor’s “renderer info” states that core
profile 3.2 is available. However, when running my app without hints, GLFW
(or OS X) defaulted to creating a GL 2.0 profile instead. My desired minimum
version as mentioned is 3.2 so my code wouldn’t work in 2.0. I have not yet
tested whether OpenWindowHints() for 3.2 work under OS X (kinda switching
back and forth between development locations & machines) but will do so
later.
However, as far as I can tell, in 2.7.6 OpenWindowHint() does not seem to
act according to its own specs on a 4-months-old Win7 64-bit machine with two
current-gen GPUs and up-to-date drivers. For Intel HD, it fails to create a
core profile with a version positively supported by the driver (and working
fine when not using Hints), for nVidia GeForce it fails to create a maximum-
version core profile and interprets “minimum desired version” as “maximum
permissible version”.
Any insights? If Hints turn out to work as expected under OS X, I’ll be happy
to use them only under OS X. Still, I’m slightly surprised how off my results
are from what one would expect as per the spec