mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
Fix Fake_glXChooseFBConfig so passing NULL attribList causes a list of all
fbconfigs to be returned.
This commit is contained in:
parent
bfc8a8dc63
commit
481bdd383a
1 changed files with 29 additions and 22 deletions
|
|
@ -1893,28 +1893,6 @@ Fake_glXGetClientString( Display *dpy, int name )
|
|||
*/
|
||||
|
||||
|
||||
static GLXFBConfig *
|
||||
Fake_glXChooseFBConfig( Display *dpy, int screen,
|
||||
const int *attribList, int *nitems )
|
||||
{
|
||||
XMesaVisual xmvis = choose_visual(dpy, screen, attribList, GL_TRUE);
|
||||
if (xmvis) {
|
||||
GLXFBConfig *config = (GLXFBConfig *) _mesa_malloc(sizeof(XMesaVisual));
|
||||
if (!config) {
|
||||
*nitems = 0;
|
||||
return NULL;
|
||||
}
|
||||
*nitems = 1;
|
||||
config[0] = (GLXFBConfig) xmvis;
|
||||
return (GLXFBConfig *) config;
|
||||
}
|
||||
else {
|
||||
*nitems = 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
Fake_glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
|
||||
int attribute, int *value )
|
||||
|
|
@ -1956,6 +1934,35 @@ Fake_glXGetFBConfigs( Display *dpy, int screen, int *nelements )
|
|||
}
|
||||
|
||||
|
||||
static GLXFBConfig *
|
||||
Fake_glXChooseFBConfig( Display *dpy, int screen,
|
||||
const int *attribList, int *nitems )
|
||||
{
|
||||
XMesaVisual xmvis;
|
||||
|
||||
if (!attribList || !attribList[0]) {
|
||||
/* return list of all configs (per GLX_SGIX_fbconfig spec) */
|
||||
return Fake_glXGetFBConfigs(dpy, screen, nitems);
|
||||
}
|
||||
|
||||
xmvis = choose_visual(dpy, screen, attribList, GL_TRUE);
|
||||
if (xmvis) {
|
||||
GLXFBConfig *config = (GLXFBConfig *) _mesa_malloc(sizeof(XMesaVisual));
|
||||
if (!config) {
|
||||
*nitems = 0;
|
||||
return NULL;
|
||||
}
|
||||
*nitems = 1;
|
||||
config[0] = (GLXFBConfig) xmvis;
|
||||
return (GLXFBConfig *) config;
|
||||
}
|
||||
else {
|
||||
*nitems = 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static XVisualInfo *
|
||||
Fake_glXGetVisualFromFBConfig( Display *dpy, GLXFBConfig config )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue