#include <cstdio>
#include <cstring>
-/* this should eventually be enabled, but causes T46431 */
-// #define USE_CONTEXT_FLAGS
-
#ifdef WITH_GLEW_MX
GLXEWContext *glxewContext = NULL;
#endif
XIOErrorHandler old_handler_io = XSetIOErrorHandler(GHOST_X11_ApplicationIOErrorHandler);
#endif
-#ifdef USE_CONTEXT_FLAGS
- /* needed so 'GLXEW_ARB_create_context' is valid */
- mxIgnoreNoVersion(1);
- initContextGLXEW();
- mxIgnoreNoVersion(0);
-#endif
+ /* important to initialize only glxew (_not_ glew),
+ * since this breaks w/ Mesa's `swrast`, see: T46431 */
+ glxewInit();
-#ifdef USE_CONTEXT_FLAGS
- if (GLXEW_ARB_create_context)
-#else
- if (0)
-#endif
- {
+ if (GLXEW_ARB_create_context) {
int profileBitCore = m_contextProfileMask & GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
int profileBitCompat = m_contextProfileMask & GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
glXMakeCurrent(m_display, m_window, m_context);
-#ifndef USE_CONTEXT_FLAGS
// Seems that this has to be called after MakeCurrent,
// which means we cannot use glX extensions until after we create a context
initContextGLXEW();
-#endif
initClearGL();
::glXSwapBuffers(m_display, m_window);
void mxMakeCurrentContext(MXContext *ctx);
void mxDestroyContext (MXContext *ctx);
-void mxIgnoreNoVersion(int ignore);
-
GLenum glew_chk(GLenum error, const char *file, int line, const char *text);
#ifndef NDEBUG
#include <stdio.h>
#include <stdlib.h>
-static int ignore_version = 0;
-
#define CASE_CODE_RETURN_STR(code) case code: return #code;
static const char *get_glew_error_enum_string(GLenum error)
const char *code = get_glew_error_enum_string(error);
const char *msg = (const char *)glewGetErrorString(error);
- if (error == GLEW_ERROR_NO_GL_VERSION && ignore_version)
+ if (error == GLEW_ERROR_NO_GL_VERSION)
return GLEW_OK;
#ifndef NDEBUG
(void)ctx;
#endif
}
-
-void mxIgnoreNoVersion(int ignore)
-{
- ignore_version = ignore;
-}