Ugly hack to avoid GLEW context error printing when initializing GLX.

master
Antony Riakiotakis 9 years ago
parent db38a65b02
commit ed3b19f46d

@ -155,7 +155,9 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
#endif
/* needed so 'GLXEW_ARB_create_context' is valid */
mxIgnoreNoVersion(1);
initContextGLXEW();
mxIgnoreNoVersion(0);
if (GLXEW_ARB_create_context) {
int profileBitCore = m_contextProfileMask & GLX_CONTEXT_CORE_PROFILE_BIT_ARB;

@ -95,6 +95,7 @@ MXContext *mxGetCurrentContext (void);
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);

@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
static int ignore_version = 0;
#define CASE_CODE_RETURN_STR(code) case code: return #code;
@ -62,6 +63,9 @@ GLenum glew_chk(GLenum error, const char *file, int line, const char *text)
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)
return GLEW_OK;
#ifndef NDEBUG
fprintf(stderr,
"%s(%d):[%s] -> GLEW Error (0x%04X): %s: %s\n",
@ -140,3 +144,8 @@ void mxDestroyContext(MXContext *ctx)
(void)ctx;
#endif
}
void mxIgnoreNoVersion(int ignore)
{
ignore_version = ignore;
}

Loading…
Cancel
Save