[Bf-blender-cvs] [034c724] soc-2014-viewport_context: added ifdefs for WITH_GLEW_MX to ContextWGL

Jason Wilkins noreply at git.blender.org
Mon Jul 28 22:38:24 CEST 2014


Commit: 034c72498738efc8cdab333899ae7a3da229ca91
Author: Jason Wilkins
Date:   Mon Jul 28 15:35:36 2014 -0500
Branches: soc-2014-viewport_context
https://developer.blender.org/rB034c72498738efc8cdab333899ae7a3da229ca91

added ifdefs for WITH_GLEW_MX to ContextWGL

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

M	intern/ghost/intern/GHOST_ContextWGL.cpp
M	intern/ghost/intern/GHOST_ContextWGL.h

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

diff --git a/intern/ghost/intern/GHOST_ContextWGL.cpp b/intern/ghost/intern/GHOST_ContextWGL.cpp
index f5370cf..9f1381f 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextWGL.cpp
@@ -40,7 +40,9 @@
 #include <vector>
 
 
+#ifdef WITH_GLEW_MX
 WGLEWContext *wglewContext = NULL;
+#endif
 
 HGLRC GHOST_ContextWGL::s_sharedHGLRC = NULL;
 int   GHOST_ContextWGL::s_sharedCount = 0;
@@ -77,8 +79,11 @@ GHOST_ContextWGL::GHOST_ContextWGL(
       m_contextMinorVersion(contextMinorVersion),
       m_contextFlags(contextFlags),
       m_contextResetNotificationStrategy(contextResetNotificationStrategy),
-      m_hGLRC(NULL),
+      m_hGLRC(NULL)
+#ifdef WITH_GLEW_MX
+      ,
       m_wglewContext(NULL)
+#endif
 #ifndef NDEBUG
       ,
       m_dummyVendor(NULL),
@@ -109,7 +114,9 @@ GHOST_ContextWGL::~GHOST_ContextWGL()
 		}
 	}
 
+#ifdef WITH_GLEW_MX
 	delete m_wglewContext;
+#endif
 
 #ifndef NDEBUG
 	delete m_dummyRenderer;
@@ -318,11 +325,13 @@ static HWND clone_window(HWND hWnd, LPVOID lpParam)
 
 void GHOST_ContextWGL::initContextWGLEW(PIXELFORMATDESCRIPTOR &preferredPFD)
 {
+#ifdef WITH_GLEW_MX
 	wglewContext = new WGLEWContext;
 	memset(wglewContext, 0, sizeof(WGLEWContext));
 
 	delete m_wglewContext;
 	m_wglewContext = wglewContext;
+#endif
 
 	HWND  dummyHWND  = NULL;
 	HDC   dummyHDC   = NULL;
diff --git a/intern/ghost/intern/GHOST_ContextWGL.h b/intern/ghost/intern/GHOST_ContextWGL.h
index f4844ed..f2a5171 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.h
+++ b/intern/ghost/intern/GHOST_ContextWGL.h
@@ -34,10 +34,15 @@
 
 #include "GHOST_Context.h"
 
+#ifdef WITH_GLEW_MX
 #define wglewGetContext() wglewContext
+#endif
+
 #include <GL/wglew.h>
-extern "C" WGLEWContext *wglewContext;
 
+#ifdef WITH_GLEW_MX 
+extern "C" WGLEWContext *wglewContext;
+#endif
 
 #ifndef GHOST_OPENGL_WGL_CONTEXT_FLAGS
 #define GHOST_OPENGL_WGL_CONTEXT_FLAGS 0
@@ -111,7 +116,9 @@ public:
 
 protected:
 	inline void activateWGLEW() const {
+#ifdef WITH_GLEW_MX 
 		wglewContext = m_wglewContext;
+#endif
 	}
 
 private:
@@ -158,8 +165,10 @@ private:
 
 	HGLRC m_hGLRC;
 
+#ifdef WITH_GLEW_MX 
 	WGLEWContext *m_wglewContext;
-
+#endif
+	
 #ifndef NDEBUG
 	const char *m_dummyVendor;
 	const char *m_dummyRenderer;




More information about the Bf-blender-cvs mailing list