summaryrefslogtreecommitdiffstats
path: root/progs/xdemos
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-05-04 15:29:25 -0400
committerKristian Høgsberg <[email protected]>2010-05-04 15:29:25 -0400
commit6a191b2713d0670f65d489cf947261fe36c5ee89 (patch)
tree66ff6fb8a73c6ca6cfcbf315a22c4b3b652039ce /progs/xdemos
parent9e4f2da848dff78fce9af1db70212c932f647a15 (diff)
glxinfo: Get visual info when an fbconfig has an associated visual
Diffstat (limited to 'progs/xdemos')
-rw-r--r--progs/xdemos/glxinfo.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c
index b656e58924e..c9e3c7bb4b8 100644
--- a/progs/xdemos/glxinfo.c
+++ b/progs/xdemos/glxinfo.c
@@ -760,19 +760,22 @@ get_fbconfig_attribs(Display *dpy, GLXFBConfig fbconfig,
struct visual_attribs *attribs)
{
int visual_type;
+ XVisualInfo *vInfo;
memset(attribs, 0, sizeof(struct visual_attribs));
glXGetFBConfigAttrib(dpy, fbconfig, GLX_FBCONFIG_ID, &attribs->id);
-#if 0
- attribs->depth = vInfo->depth;
- attribs->redMask = vInfo->red_mask;
- attribs->greenMask = vInfo->green_mask;
- attribs->blueMask = vInfo->blue_mask;
- attribs->colormapSize = vInfo->colormap_size;
- attribs->bitsPerRGB = vInfo->bits_per_rgb;
-#endif
+ vInfo = glXGetVisualFromFBConfig(dpy, fbconfig);
+
+ if (vInfo != NULL) {
+ attribs->depth = vInfo->depth;
+ attribs->redMask = vInfo->red_mask;
+ attribs->greenMask = vInfo->green_mask;
+ attribs->blueMask = vInfo->blue_mask;
+ attribs->colormapSize = vInfo->colormap_size;
+ attribs->bitsPerRGB = vInfo->bits_per_rgb;
+ }
glXGetFBConfigAttrib(dpy, fbconfig, GLX_X_VISUAL_TYPE, &visual_type);
attribs->klass = glx_token_to_visual_class(visual_type);