The only reason you could get NULL from that function call is if your OpenGL context didn't match the expected version number. In particular, if your OpenGL version is not 3.3 (or technically, not 3.0 or better). Since the loader is trying to load the 3.3 functions and such, if you don't have a context of that version, it has failed to load. So it returns that it failed to load.
You are likely getting a non-accelerated OpenGL context or something. If you're using a laptop, you're probably getting some kind of Optimus issue, where you're actually getting Intel's OpenGL instead of NVIDIA's.
I have used "GPU Caps Viewer" to check OpenGL version.
It shows as below:
Render Model: GeForce 210/PCIe/SSE2
OpenGL Version: 3.3.0
Max tess level: 0
GLSL version: 3.30 NVIDIA via Cg compiler
Texture size: 8192
Num MRT: 8
Jason McKessonrepo owner
I didn't ask what your GPU was capable of. I asked what you got in your program. Are you asking for a core 3.3 context?
I installed the newest driver and the card supports OpenGL 3.3
I didn't ask about either of those. This is not about what your card supports. It's about what your program gets when it creates an OpenGL context. Not what GPU Caps Viewer says, the actual program you're trying to use the glLoadGen generated files with.
You're creating a core OpenGL context, so you must ask for an OpenGL version, yes? Does your context creation code work?
For my case, wglGetProcAddress("glGetStringi") was NULL before calling wglCreateContext(). If I call ogl_LoadFunctions() after wglCreateContext(), it was OK.
Issue #69 was marked as a duplicate of this issue.
@zho7611 exactly, thanks! In my case it was GLFW, on Windows you have to call ogl_LoadFunctions after glfwMakeContextCurrent function. On Linux it was ok calling ogl_LoadFunctions before context creation, though.