[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25818] trunk/blender/intern/ghost/intern/ GHOST_WindowX11.cpp: Do not ask for AA if not supported.

gsr b3d gsr.b3d at infernal-iceberg.com
Fri Jan 8 00:23:00 CET 2010


Revision: 25818
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25818
Author:   gsrb3d
Date:     2010-01-08 00:23:00 +0100 (Fri, 08 Jan 2010)

Log Message:
-----------
Do not ask for AA if not supported.

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-07 22:54:05 UTC (rev 25817)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowX11.cpp	2010-01-07 23:23:00 UTC (rev 25818)
@@ -171,8 +171,14 @@
 
 	int attributes[40], i = 0;
 	Atom atoms[2];
-	int natom;	
-	
+	int natom;
+	int glxVersionMajor, glxVersionMinor; // As in GLX major.minor
+
+	if (!glXQueryVersion(m_display, &glxVersionMajor, &glxVersionMinor)) {
+		printf("%s:%d: X11 glXQueryVersion() failed, verify working openGL system!\n", __FILE__, __LINE__);
+		return;
+	}
+
 	if(m_stereoVisual)
 		attributes[i++] = GLX_STEREO;
 
@@ -183,15 +189,17 @@
 	attributes[i++] = GLX_GREEN_SIZE; attributes[i++] = 1;
 	attributes[i++] = GLX_DEPTH_SIZE; attributes[i++] = 1;
 	/* GLX 1.4+, multi-sample */
-	attributes[i++] = GLX_SAMPLE_BUFFERS; attributes[i++] = 1;
-	attributes[i++] = GLX_SAMPLES; attributes[i++] = m_numOfAASamples;
+	if((glxVersionMajor >= 1) && (glxVersionMinor >= 4)) {
+		attributes[i++] = GLX_SAMPLE_BUFFERS; attributes[i++] = 1;
+		attributes[i++] = GLX_SAMPLES; attributes[i++] = m_numOfAASamples;
+	}
 	attributes[i] = 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 for OpenGL, verify working openGL system!\n", __FILE__, __LINE__);
+		printf("%s:%d: X11 glXChooseVisual() failed, verify working openGL system!\n", __FILE__, __LINE__);
 		return;
 	}
 	





More information about the Bf-blender-cvs mailing list