summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-04-06 22:33:15 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-04-06 22:33:15 +0000
commit481bdd383ac309cda8e471215b8fd3d6b5fa8cad (patch)
treed9b015bdba13e74152befc8ba7e05b472ac6a5cc /src
parentbfc8a8dc6324f5e984566208bd0a1fa472102917 (diff)
Fix Fake_glXChooseFBConfig so passing NULL attribList causes a list of all
fbconfigs to be returned.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/x11/fakeglx.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index 5b17ae17b0..b0cb52846a 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -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 )
{