If we're using EGL and not GLX (typically because we're using GLES,
but also increasingly with desktop GL), we'd always return NULL.
This could FBOs to be confused between contexts.
#include <epoxy/wgl.h>
#else
#include <epoxy/glx.h>
+#include <epoxy/egl.h>
#endif
using namespace std;
#elif defined(WIN32)
return (void *)wglGetCurrentContext();
#else
- return (void *)glXGetCurrentContext();
+ void *ret = (void *)glXGetCurrentContext();
+ if (ret != NULL) {
+ return ret;
+ }
+ return (void *)eglGetCurrentContext();
#endif
}