Revision
264
Author
gstaplin@apple.com
Date
2009-02-26 07:45:08 -0800 (Thu, 26 Feb 2009)

Log Message

Improve the multisample_glx test.

It seems that glXCreateContext doesn't support the GLX_SAMPLE_BUFFERS and friends,
perhaps because the visuals strip out that code.  However, we can use
glXCreateNewContext (part of GLX 1.3) to create a GLXContext that does enable
the sampling.  

What's odd is that the test worked before with xserver 1.6, and 1.4
reported 0 samples, and sample buffers.

Also reindent a bit of code in glxext.c.

Modified Paths

Diff

Modified: AppleSGLX/trunk/glxext.c (263 => 264)


--- AppleSGLX/trunk/glxext.c	2009-02-26 15:04:50 UTC (rev 263)
+++ AppleSGLX/trunk/glxext.c	2009-02-26 15:45:08 UTC (rev 264)
@@ -420,7 +420,7 @@
 	    config->sampleBuffers = *bp++;
 	    break;
 	  case GLX_SAMPLES_SGIS:
-	      config->samples = *bp++;
+	    config->samples = *bp++;
 	    break;
 	  case GLX_BIND_TO_TEXTURE_RGB_EXT:
 	    config->bindToTextureRgb = *bp++;

Modified: AppleSGLX/trunk/tests/simple/multisample_glx.c (263 => 264)


--- AppleSGLX/trunk/tests/simple/multisample_glx.c	2009-02-26 15:04:50 UTC (rev 263)
+++ AppleSGLX/trunk/tests/simple/multisample_glx.c	2009-02-26 15:45:08 UTC (rev 264)
@@ -89,6 +89,8 @@
 	GLX_GREEN_SIZE, 8,
 	GLX_BLUE_SIZE, 8,
 	GLX_ALPHA_SIZE, 8,
+	GLX_SAMPLE_BUFFERS, 1,
+	GLX_SAMPLES, 1,
 	None
     };
 
@@ -157,10 +159,11 @@
 			CWBackPixel | CWBorderPixel | CWColormap | CWEventMask,
 			&attr);
    
-    ctx = glXCreateContext(dpy, visinfo, NULL, True );
+    ctx = glXCreateNewContext(dpy, fbconfig[bestfbi], GLX_WINDOW_BIT,
+			      NULL, True);
 
     if (!ctx) {
-	fprintf(stderr, "error: glXCreateContext failed!\n");
+	fprintf(stderr, "error: glXCreateNewContext failed!\n");
 	return EXIT_FAILURE;
     }