[Bf-blender-cvs] [aefd3e5] decklink: Merge remote-tracking branch 'origin/master' into decklink
Benoit Bolsee
noreply at git.blender.org
Tue Oct 20 22:07:09 CEST 2015
Commit: aefd3e555147ce4eeb57b9b8b4b74b6715389bfa
Author: Benoit Bolsee
Date: Tue Oct 20 22:03:07 2015 +0200
Branches: decklink
https://developer.blender.org/rBaefd3e555147ce4eeb57b9b8b4b74b6715389bfa
Merge remote-tracking branch 'origin/master' into decklink
===================================================================
===================================================================
diff --cc intern/ghost/intern/GHOST_ContextGLX.cpp
index 9ab1fbd,0ee8da1..439b3ba
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@@ -39,8 -39,14 +39,15 @@@
#include <cassert>
#include <cstdio>
#include <cstring>
+#include <iostream>
+ /* needed for intel drivers (works w/ mesa-swrast & nvidia) */
+ #define USE_GLXEW_INIT_WORKAROUND
+
+ #ifdef USE_GLXEW_INIT_WORKAROUND
+ static GLuint _glewStrLen(const GLubyte *s);
+ static GLboolean _glewSearchExtension(const char *name, const GLubyte *start, const GLubyte *end);
+ #endif
#ifdef WITH_GLEW_MX
GLXEWContext *glxewContext = NULL;
@@@ -413,3 -464,45 +468,45 @@@ int GHOST_X11_GL_GetAttributes
return i;
}
+
+
+ /* excuse inlining part of glew */
+ #ifdef USE_GLXEW_INIT_WORKAROUND
+ static GLuint _glewStrLen(const GLubyte *s)
+ {
+ GLuint i = 0;
+ if (s == NULL) return 0;
+ while (s[i] != '\0') i++;
+ return i;
+ }
+
+ static GLuint _glewStrCLen(const GLubyte *s, GLubyte c)
+ {
+ GLuint i = 0;
+ if (s == NULL) return 0;
+ while (s[i] != '\0' && s[i] != c) i++;
+ return (s[i] == '\0' || s[i] == c) ? i : 0;
+ }
+
+ static GLboolean _glewStrSame(const GLubyte *a, const GLubyte *b, GLuint n)
+ {
+ GLuint i = 0;
+ if (a == NULL || b == NULL)
+ return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE;
+ while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++;
+ return i == n ? GL_TRUE : GL_FALSE;
+ }
+
+ static GLboolean _glewSearchExtension(const char *name, const GLubyte *start, const GLubyte *end)
+ {
+ const GLubyte *p;
+ GLuint len = _glewStrLen((const GLubyte *)name);
+ p = start;
+ while (p < end) {
+ GLuint n = _glewStrCLen(p, ' ');
+ if (len == n && _glewStrSame((const GLubyte *)name, p, n)) return GL_TRUE;
+ p += n + 1;
+ }
+ return GL_FALSE;
+ }
-#endif /* USE_GLXEW_INIT_WORKAROUND */
++#endif /* USE_GLXEW_INIT_WORKAROUND */
More information about the Bf-blender-cvs
mailing list