[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25874] trunk/blender/intern/ghost/intern/ GHOST_WindowX11.cpp: attemp to fix [#20610] GHOST_WindowX11.cpp:202: X11 glXChooseVisual() failed, verify working openGL system!

Campbell Barton ideasman42 at gmail.com
Sun Jan 10 20:21:46 CET 2010


Revision: 25874
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25874
Author:   campbellbarton
Date:     2010-01-10 20:21:46 +0100 (Sun, 10 Jan 2010)

Log Message:
-----------
attemp to fix [#20610] GHOST_WindowX11.cpp:202: X11 glXChooseVisual() failed, verify working openGL system!
cant test but should work.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2010-01-10 19:20:48 UTC (rev 25873)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2010-01-10 19:21:46 UTC (rev 25874)
@@ -169,7 +169,7 @@
 	// Set up the minimum atrributes that we require and see if
 	// X can find us a visual matching those requirements.
 
-	int attributes[40], i = 0;
+	int attributes[40], i = 0, i_pre_aa;
 	Atom atoms[2];
 	int natom;
 	int glxVersionMajor, glxVersionMinor; // As in GLX major.minor
@@ -188,6 +188,7 @@
 	attributes[i++] = GLX_BLUE_SIZE;  attributes[i++] = 1;
 	attributes[i++] = GLX_GREEN_SIZE; attributes[i++] = 1;
 	attributes[i++] = GLX_DEPTH_SIZE; attributes[i++] = 1;
+	i_pre_aa= i;
 	/* GLX 1.4+, multi-sample */
 	if(m_numOfAASamples && (glxVersionMajor >= 1) && (glxVersionMinor >= 4)) {
 		attributes[i++] = GLX_SAMPLE_BUFFERS; attributes[i++] = 1;
@@ -198,9 +199,17 @@
 	m_visual = glXChooseVisual(m_display, DefaultScreen(m_display), attributes);
 
 	if (m_visual == NULL) {
-		// barf : no visual meeting these requirements could be found.
-		printf("%s:%d: X11 glXChooseVisual() failed, verify working openGL system!\n", __FILE__, __LINE__);
-		return;
+		/* possibly the X Server does not support GLX_SAMPLE_BUFFERS */
+		attributes[i_pre_aa] = None;
+		m_visual = glXChooseVisual(m_display, DefaultScreen(m_display), attributes);
+
+		if (m_visual == NULL) {
+			// barf : no visual meeting these requirements could be found.
+			printf("%s:%d: X11 glXChooseVisual() failed, verify working openGL system!\n", __FILE__, __LINE__);
+			return;
+		} else {
+			printf("%s:%d: X11 glXChooseVisual() multi-sample failed, continue with multisample disabled\n", __FILE__, __LINE__);
+		}
 	}
 	
 	memset(&m_xtablet, 0, sizeof(m_xtablet));





More information about the Bf-blender-cvs mailing list