glfwGetProcAddress()

nobody wrote on Friday, March 31, 2006:

Why glfwGetProcAddress() is returning NULL?

PFNGLBINDBUFFERPROC glBindBuffer;
PFNGLBUFFERDATAPROC glBufferData;
PFNGLBUFFERSUBDATAPROC glBufferSubData;
PFNGLDELETEBUFFERSPROC glDeleteBuffers;
PFNGLGENBUFFERSPROC glGenBuffers;
PFNGLMAPBUFFERPROC glMapBuffer;
PFNGLUNMAPBUFFERPROC glUnmapBuffer;

     glBindBuffer = \(PFNGLBINDBUFFERPROC\) glfwGetProcAddress\("glBindBuffer"\);
     glBufferData = \(PFNGLBUFFERDATAPROC\) glfwGetProcAddress\("glBufferData"\);
     glBufferSubData = \(PFNGLBUFFERSUBDATAPROC\) glfwGetProcAddress\("glBufferSubData"\);
     glDeleteBuffers = \(PFNGLDELETEBUFFERSPROC\) glfwGetProcAddress\("glDeleteBuffers"\);
     glGenBuffers = \(PFNGLGENBUFFERSPROC\) glfwGetProcAddress\("glGenBuffers"\);
     glMapBuffer = \(PFNGLMAPBUFFERPROC\) glfwGetProcAddress\("glMapBuffer"\);
     glUnmapBuffer = \(PFNGLUNMAPBUFFERPROC\) glfwGetProcAddress\("glUnmapBuffer"\);

     if\(glBindBuffer == NULL\) printf\("glBindBuffer is NULL\n"\);
     if\(glBufferData == NULL\) printf\("glBufferData is NULL\n"\);
     if\(glBufferSubData == NULL\) printf\("glBufferSubData is NULL\n"\);
     if\(glDeleteBuffers == NULL\) printf\("glDeleteBuffers is NULL\n"\);
     if\(glGenBuffers == NULL\) printf\("glGenBuffers is NULL\n"\);
     if\(glMapBuffer == NULL\) printf\("glMapBuffer is NULL\n"\);
     if\(glUnmapBuffer == NULL\) printf\("glUnmapBuffer is NULL\n"\);

And it always displays that everything is NULL.
And it’s not cause of hardware (GLEW is supporting this feature).

elmindreda wrote on Friday, March 31, 2006:

Probably because the function names have an ARB suffix.

nobody wrote on Thursday, April 06, 2006:

You probably read this already, but I’ll post it anyway on the off chance it applies to your situation and you just overlooked it.
Notes for glGetProcAddress():
[quote]
An OpenGLTM context must be created before this function can be called (i.e. an OpenGLTM window
must have been opened with glfwOpenWindow).
Some systems do not support dynamic function pointer retrieval, in which case glfwGetProcAddress
will always return NULL.
[/quote]