I am trying to configure GLFW3 for my OpenGL project on Xcode 5 (Mac OSX 10.8.4). I successfully installed and linked my project with GLFW3 without any problems. I even got a window that was successfully created with the project, and I was able to detect mouse and keyboard inputs with the window, so I believe that I connected GLFW3 correctly (or at least it seemed so).
However, a problem arose when I tried to draw an object. This was a piece of code in which an error appeared:
#include <GLFW/glfw3.h> void LoadObject() { glGenVertexArrays(1, &VAO_myObj); // ERROR : Use of undeclared identifier 'glGenVertexArrays' glBindVertexArray(VAO_myObj); // ERROR : Use of undeclared identifier 'glBindVertexArray' glGenBuffers(1, &VBO_myObj); // No error glBindBuffer(GL_ARRAY_BUFFER, VBO_myObj); // No error glBufferData(blah blah blah); // No error glEnableVertexAttribArray(0); // No error glVertexAttribPointer(blah); // No error glBindBuffer(GL_ARRAY_BUFFER, 0); // No error glBindVertexArray(0); // ERROR : Use of undeclared identifier 'glBindVertexArray' }
So, it made me believe that somehow GLFW3 could not connect these functions (?). When I typed "glGen ..." in Xcode, I saw only 4 functions in a popup:
void glGenBuffers(GLsizei n, GLuint * buffers) GLuint glGenLists(GLsizei range) void glGenQueries(GLsizei n, GLuint * ids) void glGenTextures(GLsizei n, GLuint * textures)
So, it is most likely that glGenVertexArrays () was really missing from the library.
Similarly for "glBind ...", when I enter the name in Xcode, only in the popup they were displayed:
void glBindAttribLocation(GLuint program, GLuint index, const GLchar * name) void glBindBuffer(GLenum target, GLuint buffer) void glBindTexture(GLenum target, GLuint texture)
No where I saw glBindVertexArray () in the list.
So it seems that glGenVertexArrays () and glBindVertexArray () are missing. But how could they miss such important features? Therefore, most likely, I missed something myself.
I'm just wondering if anyone has encountered this problem with GLFW3 with Xcode 5 before? By the way, I do not use glew or other OpenGL support tools. I use only GLFW3.
I would appreciate any hint or pointer to this problem.
On a side note, which tool (next to glfw) would you recommend getting a window on a Mac for a modern (shader-based) OpenGL project?
Thank you in advance for your help.