diff options
author | Brian Paul <[email protected]> | 2004-02-02 15:40:21 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-02-02 15:40:21 +0000 |
commit | 3a99674980c1fd76649ac48a95402bedc75a5e46 (patch) | |
tree | 24f8a700bdedfacb919f0cf5990a26b711823866 /src/mesa/drivers/x11 | |
parent | 18a949000cee8f8e63b633b628bbdbc8196fe7de (diff) |
glXChooseFBConfig() didn't handle GLX_FBCONFIG_ID option
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r-- | src/mesa/drivers/x11/fakeglx.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 262ede197eb..d82e5073c3f 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 5.1 + * Version: 6.0.1 * - * Copyright (C) 1999-2003 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -933,6 +933,7 @@ static XMesaVisual choose_visual( Display *dpy, int screen, const int *list ) int trans_value = DONT_CARE; GLint caveat = DONT_CARE; XMesaVisual xmvis = NULL; + int desiredVisualID = -1; parselist = list; @@ -1088,8 +1089,13 @@ static XMesaVisual choose_visual( Display *dpy, int screen, const int *list ) } parselist++; break; + case GLX_FBCONFIG_ID: + parselist++; + desiredVisualID = *parselist; + break; case None: + /* end of list */ break; default: @@ -1109,7 +1115,24 @@ static XMesaVisual choose_visual( Display *dpy, int screen, const int *list ) * double buffering, depth buffer, etc. will be associated with the X * visual and stored in the VisualTable[]. */ - if (level==0) { + if (desiredVisualID != -1) { + /* try to get a specific visual, by visualID */ + XVisualInfo temp; + int n; + temp.visualid = desiredVisualID; + temp.screen = screen; + vis = XGetVisualInfo(dpy, VisualIDMask | VisualScreenMask, &temp, &n); + if (vis) { + /* give the visual some useful GLX attributes */ + double_flag = GL_TRUE; + if (vis->depth > 8) + rgb_flag = GL_TRUE; + depth_size = DEFAULT_SOFTWARE_DEPTH_BITS; + stencil_size = STENCIL_BITS; + /* XXX accum??? */ + } + } + else if (level==0) { /* normal color planes */ if (rgb_flag) { /* Get an RGB visual */ |