[Bf-blender-cvs] [a8d2a6f] soc-2014-viewport_context: GLX and WGL should now build when using WITH_SYSTEM_GLEW=ON or WITH_GLEW_ES=OFF

Jason Wilkins noreply at git.blender.org
Sun Aug 3 20:38:17 CEST 2014


Commit: a8d2a6faf3beaf8363bd71c65c59e0ed1a1e7b5c
Author: Jason Wilkins
Date:   Sun Aug 3 13:38:08 2014 -0500
Branches: soc-2014-viewport_context
https://developer.blender.org/rBa8d2a6faf3beaf8363bd71c65c59e0ed1a1e7b5c

GLX and WGL should now build when using WITH_SYSTEM_GLEW=ON or WITH_GLEW_ES=OFF

===================================================================

M	intern/ghost/intern/GHOST_ContextGLX.cpp
M	intern/ghost/intern/GHOST_ContextWGL.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 43c8c0c..6827e5c 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -140,8 +140,7 @@ void GHOST_ContextGLX::initContextGLXEW()
 	m_glxewContext = glxewContext;
 #endif
 
-	if (GLEW_CHK(glxewInit()) != GLEW_OK)
-		fprintf(stderr, "Warning! GLXEW failed to initialize properly.\n");
+	initContextGLEW();
 }
 
 GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
@@ -281,8 +280,6 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
 
 		glXMakeCurrent(m_display, m_window, m_context);
 
-		initContextGLEW();
-
 		// Seems that this has to be called after MakeCurrent,
 		// which means we cannot use glX extensions until after we create a context
 		initContextGLXEW();
diff --git a/intern/ghost/intern/GHOST_ContextWGL.cpp b/intern/ghost/intern/GHOST_ContextWGL.cpp
index b752979..de7a7f5d 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextWGL.cpp
@@ -375,8 +375,13 @@ void GHOST_ContextWGL::initContextWGLEW(PIXELFORMATDESCRIPTOR &preferredPFD)
 	if (!WIN32_CHK(::wglMakeCurrent(dummyHDC, dummyHGLRC)))
 		goto finalize;
 
+#ifdef WITH_GLEW_MX
 	if (GLEW_CHK(wglewInit()) != GLEW_OK)
 		fprintf(stderr, "Warning! WGLEW failed to initialize properly.\n");
+#else
+	if (GLEW_CHK(glewInit()) != GLEW_OK)
+		fprintf(stderr, "Warning! Dummy GLEW/WGLEW failed to initialize properly.\n");
+#endif
 
 	// the following are not technially WGLEW, but they also require a context to work




More information about the Bf-blender-cvs mailing list