summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-01-07 01:17:42 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-01-07 01:17:42 +0000
commitba5ceda7e0f55fb59a674a5439a44464cae4b28d (patch)
tree67e4feed59592babfb39002fc1f2a24e14fe4fa5 /progs
parent7e3379b1a0f1837e432323f60885e5c8e38c2699 (diff)
added GetAllFBConfigs()
Diffstat (limited to 'progs')
-rw-r--r--progs/xdemos/pbutil.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/progs/xdemos/pbutil.c b/progs/xdemos/pbutil.c
index 50456e9f94..a3d66da481 100644
--- a/progs/xdemos/pbutil.c
+++ b/progs/xdemos/pbutil.c
@@ -78,6 +78,29 @@ ChooseFBConfig(Display *dpy, int screen, const int attribs[], int *nConfigs)
}
+FBCONFIG *
+GetAllFBConfigs(Display *dpy, int screen, int *nConfigs)
+{
+ int pbSupport = QueryPbuffers(dpy, screen);
+#if defined(GLX_VERSION_1_3)
+ if (pbSupport == 1) {
+ return glXGetFBConfigs(dpy, screen, nConfigs);
+ }
+#endif
+#if defined(GLX_SGIX_fbconfig) && defined(GLX_SGIX_pbuffer)
+ if (pbSupport == 2) {
+ /* this *seems* to work, but may not be perfect */
+ static int fbAttribs[] = {
+ GLX_RENDER_TYPE, 0,
+ GLX_DRAWABLE_TYPE, 0,
+ None
+ };
+ return glXChooseFBConfigSGIX(dpy, screen, fbAttribs, nConfigs);
+ }
+#endif
+ return NULL;
+}
+
XVisualInfo *
GetVisualFromFBConfig(Display *dpy, int screen, FBCONFIG config)