Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-07-20 15:56:36 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-07-20 15:56:36 +0300
commited3b19f46d5f85910b46f7e3e2f21b55eefc9ada (patch)
tree61554588800fcc5aeea3ce6843332ada73634350 /intern
parentdb38a65b022cd11892034d6882d643fd46d618c8 (diff)
Ugly hack to avoid GLEW context error printing when initializing GLX.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_ContextGLX.cpp2
-rw-r--r--intern/glew-mx/glew-mx.h1
-rw-r--r--intern/glew-mx/intern/glew-mx.c9
3 files changed, 12 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 0b4d41b61fe..3cce2236143 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -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;
diff --git a/intern/glew-mx/glew-mx.h b/intern/glew-mx/glew-mx.h
index cf90870261c..92450d67812 100644
--- a/intern/glew-mx/glew-mx.h
+++ b/intern/glew-mx/glew-mx.h
@@ -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);
diff --git a/intern/glew-mx/intern/glew-mx.c b/intern/glew-mx/intern/glew-mx.c
index 8b0ab42c0c0..78920670f68 100644
--- a/intern/glew-mx/intern/glew-mx.c
+++ b/intern/glew-mx/intern/glew-mx.c
@@ -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;
+}