I'm trying to create a GLX backend for a project. The project originally used GLEW but I couldn't figure out how to initialize GLX without a context.
GLX doesn't require a context to fetch its own entry points. glXGetProcAddress is supposed to always be exported statically (assuming 1.4 is available).
In the header, I see this:
#ifdef GLEW_MX typedef struct GLXEWContextStruct GLXEWContext; GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx); GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name); #define glxewInit() glxewContextInit(glxewGetContext()) #define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x)
However, glxewGetContext() doesn't exist. It also does not make sense to have them oriented with a context as the returned functions context-independent.
A temporary work around for this is to create glX function pointers yourself, define glXGetProcAddress, and fetch the functions yourself... defeating the entire purpose of glxew in the first place.