瀏覽代碼

New GetAllFBConfigs() function. Some FBConfigs weren't reported before.

tags/jump_and_click
Brian Paul 21 年之前
父節點
當前提交
71fc6a3fc9
共有 2 個檔案被更改,包括 8 行新增23 行删除
  1. 4
    23
      progs/xdemos/pbinfo.c
  2. 4
    0
      progs/xdemos/pbutil.h

+ 4
- 23
progs/xdemos/pbinfo.c 查看文件

@@ -23,29 +23,10 @@ PrintConfigs(Display *dpy, int screen, Bool horizFormat)
FBCONFIG *fbConfigs;
int nConfigs;
int i;
/* Note: you may want to tweek the attribute list to select a different
* set of fbconfigs.
*/
int fbAttribs[] = {
GLX_RENDER_TYPE, 0,
GLX_DRAWABLE_TYPE, 0,
#if 0
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 1,
GLX_DOUBLEBUFFER, 0,
GLX_STENCIL_SIZE, 0,
#endif
None};


/* Get list of possible frame buffer configurations */
fbConfigs = ChooseFBConfig(dpy, screen, fbAttribs, &nConfigs);

fbConfigs = GetAllFBConfigs(dpy, screen, &nConfigs);
if (!nConfigs || !fbConfigs) {
printf("Error: glxChooseFBConfig failed\n");
printf("Error: glxGetFBConfigs failed\n");
return;
}

@@ -57,7 +38,7 @@ PrintConfigs(Display *dpy, int screen, Bool horizFormat)
}

/* Print config info */
for (i=0;i<nConfigs;i++) {
for (i = 0; i < nConfigs; i++) {
PrintFBConfigInfo(dpy, screen, fbConfigs[i], horizFormat);
}


+ 4
- 0
progs/xdemos/pbutil.h 查看文件

@@ -38,6 +38,10 @@ extern FBCONFIG *
ChooseFBConfig(Display *dpy, int screen, const int attribs[], int *nConfigs);


extern FBCONFIG *
GetAllFBConfigs(Display *dpy, int screen, int *nConfigs);


extern XVisualInfo *
GetVisualFromFBConfig(Display *dpy, int screen, FBCONFIG config);


Loading…
取消
儲存