Run-time bound OpenGL

nobody wrote on Wednesday, December 06, 2006:

My program doesn’t link to any OpenGL library. The library is
loaded at runtime with dlopen() (or whatever’s available on the
target platform) and all OpenGL functions are called indirectly
via pointers. This is to allow, for example, a user to load a
fast software emulation like TinyGL if they don’t have hardware
acceleration.

The problem is: glfw makes a few OpenGL calls directly from the
windowing code. This forces the application to actually link
against OpenGL.

A solution is to provide a public structure with function pointers
and allow the client code to set these function pointers before
initialization.

Any thoughts?

elmindreda wrote on Thursday, December 07, 2006:

That’s certainly doable, but not interesting for the main branch at the moment. However, if you do implement it, you’re welcome to submit a patch for it.