summaryrefslogtreecommitdiff
path: root/progs/xdemos/pbdemo.c
diff options
context:
space:
mode:
Diffstat (limited to 'progs/xdemos/pbdemo.c')
-rw-r--r--progs/xdemos/pbdemo.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/progs/xdemos/pbdemo.c b/progs/xdemos/pbdemo.c
index 7db0017b33..277df72924 100644
--- a/progs/xdemos/pbdemo.c
+++ b/progs/xdemos/pbdemo.c
@@ -131,6 +131,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height )
fbConfigs = ChooseFBConfig(dpy, screen, fbAttribs[attempt], &nConfigs);
if (nConfigs==0 || !fbConfigs) {
printf("Note: glXChooseFBConfig(%s) failed\n", fbString[attempt]);
+ XFree(fbConfigs);
continue;
}
@@ -143,7 +144,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height )
/* Create the pbuffer using first fbConfig in the list that works. */
for (i=0;i<nConfigs;i++) {
- pBuffer = CreatePbuffer(dpy, screen, fbConfigs[i], width, height, preserve, largest);
+ pBuffer = CreatePbuffer(dpy, screen, fbConfigs[i], width, height, largest, preserve);
if (pBuffer) {
gFBconfig = fbConfigs[i];
gWidth = width;
@@ -210,6 +211,21 @@ Setup(int width, int height)
return 0;
}
+ /* Test drawable queries */
+ {
+ unsigned int v;
+ glXQueryDrawable( gDpy, gPBuffer, GLX_WIDTH, &v);
+ printf("GLX_WIDTH = %u\n", v);
+ glXQueryDrawable( gDpy, gPBuffer, GLX_HEIGHT, &v);
+ printf("GLX_HEIGHT = %u\n", v);
+ glXQueryDrawable( gDpy, gPBuffer, GLX_PRESERVED_CONTENTS, &v);
+ printf("GLX_PRESERVED_CONTENTS = %u\n", v);
+ glXQueryDrawable( gDpy, gPBuffer, GLX_LARGEST_PBUFFER, &v);
+ printf("GLX_LARGEST_PBUFFER = %u\n", v);
+ glXQueryDrawable( gDpy, gPBuffer, GLX_FBCONFIG_ID, &v);
+ printf("GLX_FBCONFIG_ID = %u\n", v);
+ }
+
/* Get corresponding XVisualInfo */
visInfo = GetVisualFromFBConfig(gDpy, gScreen, gFBconfig);
if (!visInfo) {