[Bf-blender-cvs] [bd28c25] master: Fix broken GLEW initialization. Initialize GLEW twice, once to get GLX extensions, once to get final context extensions.

Antony Riakiotakis noreply at git.blender.org
Mon Jul 20 12:36:10 CEST 2015


Commit: bd28c25f9b9006608a86ee9f747c9bd433fa9ccc
Author: Antony Riakiotakis
Date:   Mon Jul 20 12:35:58 2015 +0200
Branches: master
https://developer.blender.org/rBbd28c25f9b9006608a86ee9f747c9bd433fa9ccc

Fix broken GLEW initialization. Initialize GLEW twice, once to get GLX
extensions, once to get final context extensions.

Not so nice because we get a warning on startup from GLEW, but at least
it GL extensions should work now.

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

M	intern/ghost/intern/GHOST_ContextGLX.cpp

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

diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 487e493..0b4d41b 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -102,7 +102,8 @@ GHOST_ContextGLX::~GHOST_ContextGLX()
 		}
 
 #ifdef WITH_GLEW_MX
-		delete m_glxewContext;
+		if (m_glxewContext)
+			delete m_glxewContext;
 #endif
 	}
 }
@@ -135,7 +136,8 @@ void GHOST_ContextGLX::initContextGLXEW()
 	glxewContext = new GLXEWContext;
 	memset(glxewContext, 0, sizeof(GLXEWContext));
 
-	delete m_glxewContext;
+	if (m_glxewContext)
+		delete m_glxewContext;
 	m_glxewContext = glxewContext;
 #endif
 
@@ -262,6 +264,9 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
 		initClearGL();
 		::glXSwapBuffers(m_display, m_window);
 
+		/* re initialize to get the extensions properly */
+		initContextGLXEW();
+
 		success = GHOST_kSuccess;
 	}
 	else {




More information about the Bf-blender-cvs mailing list