Hi,
I’m trying to get some code working using glfw in “Core Profile” mode on Mac
OS X Lion (10.7.2), which enables OpenGL 3.2. I can get everything set up
using glfwOpenWindowHint(GLFW_OPENGL_PROFILE,
GLFW_OPENGL_CORE_PROFILE);
However, according to Apple you need to include gl3.h not gl.h in core profile
mode. However as far as I can tell glfw is only including gl.h. I can manually
include gl3.h but this generates warnings about incompatible modes.
I’m also having trouble getting glBindFragDataLocation to work correctly
(necessary to bind the fragment shader output colour to the frame buffer - at
this is only defined in gl3.h). If anyone can point me to a GL 3.2 example
working under Lion (e.g. one that doesn’t use any immediate mode calls,
matrix stack, etc.)) it would be much appreciated!
Thanks,
This is a known problem. GLFW 2.7.3, which will be released shortly,
introduces the GLFW_INCLUDE_GL3 macro, which will make glfw.h include gl3.h
instead of gl.h.
Thanks for the reply! I downloaded the svn version and installed it and
defined the GLFW_INCLUDE_GL3 & GLFW_NO_GLU macros. While this is good, I
think this means you can’t select at run time if you want to run in
compatibility or core profile mode anymore.
Unfortunately GLEW doesn’t handle the 3.2 core profile correctly on Mac OS
10.7 when using glfw. For example glGenVertexArrays is NULL with glew and
glfw, but if I run glewinfo | fgrep glGenVertexArrays, I get:
glGenVertexArraysAPPLE: OK
glGenVertexArrays: OK
To answer my own question (see: http://www.opengl.org/wiki/OpenGL_Loading_
Library): setting
glewExperimental = true before calling glewInit solves the problem (kind
of), however following initialisation glGetError returns 1280 (before
calling any gl commands).
There also seems to be a problem with GLFW in core profile mode when trying to
do fullscreen. I get the following error:
invalid pixel format attribute
NSMapGet: map table argument is NULL
when trying to open a window using Core Profile hints.