[Bf-blender-cvs] [c899c7c9e12] blender2.8: Check we've got GLEW version 2 when building with core profile
Sergey Sharybin
noreply at git.blender.org
Mon May 1 11:18:34 CEST 2017
Commit: c899c7c9e128dae2beba307a376118e9eb5aaf58
Author: Sergey Sharybin
Date: Mon May 1 10:37:04 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBc899c7c9e128dae2beba307a376118e9eb5aaf58
Check we've got GLEW version 2 when building with core profile
There was a bug in older GLEW version which kept glGenVertexArrays as NULL
when 3.2 core context is requested [1].
Didn't find a way to check GLEW version from CMake, it seems the version
is not really exposed to the header.
[1] https://sourceforge.net/p/glew/bugs/124/
===================================================================
M intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 7dc3f917fde..11f3a6ea406 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -1329,6 +1329,16 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
// try 3.3 core profile
// no fallbacks
+#if defined(WITH_GL_PROFILE_CORE)
+ {
+ const char *version_major = (char*)glewGetString(GLEW_VERSION_MAJOR);
+ if (version_major != NULL && version_major[0] == '1') {
+ fprintf(stderr, "Error: GLEW version 2.0 and above is required.\n");
+ abort();
+ }
+ }
+#endif
+
const int profile_mask =
#if defined(WITH_GL_PROFILE_CORE)
GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
More information about the Bf-blender-cvs
mailing list