3 * Print list of fbconfigs and test each to see if a pbuffer can be created
8 * Updated on 5 October 2002.
21 PrintConfigs(Display
*dpy
, int screen
, Bool horizFormat
)
23 GLXFBConfigSGIX
*fbConfigs
;
26 /* Note: you may want to tweek the attribute list to select a different
30 GLX_RENDER_TYPE_SGIX
, 0,
31 GLX_DRAWABLE_TYPE_SGIX
, 0,
33 GLX_RENDER_TYPE_SGIX
, GLX_RGBA_BIT_SGIX
,
34 GLX_DRAWABLE_TYPE_SGIX
, GLX_PIXMAP_BIT_SGIX
,
45 /* Get list of possible frame buffer configurations */
48 fbConfigs
= glXChooseFBConfigSGIX(dpy
, screen
, fbAttribs
, &nConfigs
);
52 fbConfigs
= glXGetFBConfigs(dpy
, screen
, &nConfigs
);
55 if (nConfigs
==0 || !fbConfigs
) {
56 printf("Error: glxChooseFBConfigSGIX failed\n");
60 printf("Number of fbconfigs: %d\n", nConfigs
);
63 printf(" ID VisualType Depth Lvl RGB CI DB Stereo R G B A");
64 printf(" Z S AR AG AB AA MSbufs MSnum Pbuffer\n");
67 /* Print config info */
68 for (i
=0;i
<nConfigs
;i
++) {
69 PrintFBConfigInfo(dpy
, fbConfigs
[i
], horizFormat
);
82 printf(" -display <display-name> specify X display name\n");
83 printf(" -t print in tabular format\n");
84 printf(" -v print in verbose format\n");
85 printf(" -help print this information\n");
90 main(int argc
, char *argv
[])
95 Bool horizFormat
= True
;
98 for (i
=1; i
<argc
; i
++) {
99 if (strcmp(argv
[i
],"-display")==0) {
105 else if (strcmp(argv
[i
],"-t")==0) {
109 else if (strcmp(argv
[i
],"-v")==0) {
113 else if (strcmp(argv
[i
],"-help")==0) {
118 printf("Unknown option: %s\n", argv
[i
]);
122 dpy
= XOpenDisplay(dpyName
);
125 printf("Error: couldn't open display %s\n", dpyName
? dpyName
: ":0");
129 scrn
= DefaultScreen(dpy
);
130 PrintConfigs(dpy
, scrn
, horizFormat
);