f0b2f0eed4c85e3c6e60e4ff8eff9a3b81600d29
1 /* $Id: pbinfo.c,v 1.2 2003/04/21 14:51:16 brianp Exp $ */
4 * Print list of fbconfigs and test each to see if a pbuffer can be created
9 * Updated on 5 October 2002.
22 PrintConfigs(Display
*dpy
, int screen
, Bool horizFormat
)
24 GLXFBConfigSGIX
*fbConfigs
;
27 /* Note: you may want to tweek the attribute list to select a different
31 GLX_RENDER_TYPE_SGIX
, 0,
32 GLX_DRAWABLE_TYPE_SGIX
, 0,
34 GLX_RENDER_TYPE_SGIX
, GLX_RGBA_BIT_SGIX
,
35 GLX_DRAWABLE_TYPE_SGIX
, GLX_PIXMAP_BIT_SGIX
,
46 /* Get list of possible frame buffer configurations */
49 fbConfigs
= glXChooseFBConfigSGIX(dpy
, screen
, fbAttribs
, &nConfigs
);
53 fbConfigs
= glXGetFBConfigs(dpy
, screen
, &nConfigs
);
56 if (nConfigs
==0 || !fbConfigs
) {
57 printf("Error: glxChooseFBConfigSGIX failed\n");
61 printf("Number of fbconfigs: %d\n", nConfigs
);
64 printf(" ID VisualType Depth Lvl RGB CI DB Stereo R G B A");
65 printf(" Z S AR AG AB AA MSbufs MSnum Pbuffer\n");
68 /* Print config info */
69 for (i
=0;i
<nConfigs
;i
++) {
70 PrintFBConfigInfo(dpy
, fbConfigs
[i
], horizFormat
);
83 printf(" -display <display-name> specify X display name\n");
84 printf(" -t print in tabular format\n");
85 printf(" -v print in verbose format\n");
86 printf(" -help print this information\n");
91 main(int argc
, char *argv
[])
96 Bool horizFormat
= True
;
99 for (i
=1; i
<argc
; i
++) {
100 if (strcmp(argv
[i
],"-display")==0) {
106 else if (strcmp(argv
[i
],"-t")==0) {
110 else if (strcmp(argv
[i
],"-v")==0) {
114 else if (strcmp(argv
[i
],"-help")==0) {
119 printf("Unknown option: %s\n", argv
[i
]);
123 dpy
= XOpenDisplay(dpyName
);
126 printf("Error: couldn't open display %s\n", dpyName
? dpyName
: ":0");
130 scrn
= DefaultScreen(dpy
);
131 PrintConfigs(dpy
, scrn
, horizFormat
);