http://www.jwz.org/xscreensaver/xscreensaver-5.13.tar.gz
[xscreensaver] / driver / xdpyinfo.c
index acce04438bb99a7de70e8eb183e5674c3c740dbd..9f679665f479326383ee39766b947e875e1aa4a3 100644 (file)
@@ -23,13 +23,15 @@ used in advertising or otherwise to promote the sale, use or other dealings
 in this Software without prior written authorization from The Open Group.
  *
  * Author:  Jim Fulton, MIT X Consortium
+ *
  * GLX and Overlay support added by Jamie Zawinski <jwz@jwz.org>, 11-Nov-99
  *
  *      To compile:
- *         cc -DHAVE_GLX glxdpyinfo.c -o glxdpyinfo -lGL -lX11 -lXext -lm
+ *         cc -DHAVE_GLX xdpyinfo.c -o xdpyinfo -lGL -lX11 -lXext [-lXtst] -lm
  *
  *      Other defines to consider:
- *         -DHAVE_XIE -DHAVE_XTEST -DHAVE_SYNC -DHAVE_XRECORD
+ *         -DMITSHM -DHAVE_XDBE -DHAVE_XIE -DHAVE_XTEST -DHAVE_SYNC
+ *         -DHAVE_XRECORD
  */
 
 #include <X11/Xlib.h>
@@ -45,7 +47,9 @@ in this Software without prior written authorization from The Open Group.
 #ifdef HAVE_XSYNC
 #include <X11/extensions/sync.h>
 #endif /* HAVE_XSYNC */
+#ifdef HAVE_XDBE
 #include <X11/extensions/Xdbe.h>
+#endif /* HAVE_XDBE */
 #ifdef HAVE_XRECORD
 #include <X11/extensions/record.h>
 #endif /* HAVE_XRECORD */
@@ -187,15 +191,28 @@ print_glx_visual_info (dpy, vip)
       value != 0)
     printf ("    GLX stencil size:  %d\n", value);
 
-# ifdef GLX_SAMPLE_BUFFERS_SGIS
-  if (!glXGetConfig (dpy, vip, GLX_SAMPLE_BUFFERS_SGIS, &value) &&
-      value != 0)
+# if defined(GL_SAMPLE_BUFFERS)
+#  define SB GL_SAMPLE_BUFFERS
+#  define SM GL_SAMPLES
+# elif defined(GLX_SAMPLE_BUFFERS)
+#  define SB GLX_SAMPLE_BUFFERS
+#  define SM GLX_SAMPLES
+# elif defined(GLX_SAMPLE_BUFFERS_ARB)
+#  define SB GLX_SAMPLE_BUFFERS_ARB
+#  define SM GLX_SAMPLES_ARB
+# elif defined(GLX_SAMPLE_BUFFERS_SGIS)
+#  define SB GLX_SAMPLE_BUFFERS_SGIS
+#  define SM GLX_SAMPLES_SGIS
+# endif
+
+# ifdef SB
+  if (!glXGetConfig (dpy, vip, SB, &value) && value != 0)
     {
       int bufs = value;
-      if (!glXGetConfig (dpy, vip, GLX_SAMPLES_SGIS, &value))
-        printf ("    GLX multisamplers: %d (%d)\n", bufs, value);
+      if (!glXGetConfig (dpy, vip, SM, &value))
+        printf ("    GLX multisample:   %d, %d\n", bufs, value);
     }
-# endif
+# endif /* SB */
 
   if (!glXGetConfig (dpy, vip, GLX_TRANSPARENT_TYPE_EXT, &value) &&
       value != GLX_NONE_EXT)
@@ -872,6 +889,7 @@ print_mitshm_info(dpy, extname)
 }
 #endif /* MITSHM */
 
+#ifdef HAVE_XDBE
 int
 print_dbe_info(dpy, extname)
     Display *dpy;
@@ -901,6 +919,7 @@ print_dbe_info(dpy, extname)
     XdbeFreeVisualInfo(svi);
     return 1;
 }
+#endif /* HAVE_XDBE */
 
 #ifdef HAVE_XRECORD
 int
@@ -948,7 +967,9 @@ ExtensionPrintInfo known_extensions[] =
 #ifdef HAVE_XTEST
     {XTestExtensionName, print_xtest_info, False},
 #endif /* HAVE_XTEST */
+#ifdef HAVE_XDBE
     {"DOUBLE-BUFFER", print_dbe_info, False},
+#endif /* HAVE_XDBE */
 #ifdef HAVE_XRECORD
     {"RECORD", print_record_info, False}    
 #endif /* HAVE_XRECORD */