#240 Strange glxew behaviors


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.


  • Anonymous - 2014-01-27

    Oh, apparently you can just make your own struct and call glxewContextInit. However, in glew.c... the struct instance isn't used for anything. If GLEW_MX isn't defined, GLXEW_CONTEXT_ARG_DEF_LIST (which is what is passed) is actually considered void...

    So... is glxewContextInit(void) supposed to be a thing (except missed in the header)?

  • Anonymous - 2014-01-31

    If I could just have some insight on the intended purpose, I would gladly submit a patch or branched git repo.

  • Nigel Stewart

    Nigel Stewart - 2014-02-20
    • Group: 1.10.1 --> 1.10.2
    • Priority: 8 --> 7
  • Nigel Stewart

    Nigel Stewart - 2014-02-20

    Deferring this, for now.

  • Nigel Stewart

    Nigel Stewart - 2014-08-12
    • Group: 1.10.2 --> 1.11.2
  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2015-08-06

    I'm not really understanding why this functionality hasn't been removed completely. It's clearly not supported very well, especially so since I can't even figure out the original intention.

    Perhaps wglew and glxew should just be removed?

  • Nigel Stewart

    Nigel Stewart - 2015-08-06

    It would probably be helpful to clarify here that we're not talking about MX mode here, being the multiple context variant of GLEW. You're saying that you can't create a context without GLEW, but you can't initialize GLEW without a context, right? That's the crux of the issue?

  • Nigel Stewart

    Nigel Stewart - 2015-08-11

    1.13.0 exposes glxewInit and wglewInit

  • Nigel Stewart

    Nigel Stewart - 2015-08-11
    • assigned_to: Nigel Stewart
    • Group: 1.12.1 --> 1.13.1
  • Nigel Stewart

    Nigel Stewart - 2016-02-06

    Closing this. As far as I can tell, glxewInit is working as intended.

  • Nigel Stewart

    Nigel Stewart - 2016-02-06
    • status: open --> closed
    • Group: 1.13.1 --> 2.0.0