summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/x11/fakeglx.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-03-21 17:05:03 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-03-21 17:05:03 +0000
commit894844a8d956a0ee5f95836331dc318f49fdb845 (patch)
tree92aab765e7c82edf310ce1a5d3f1b25cfabc5156 /src/mesa/drivers/x11/fakeglx.c
parent009501642533c7378fc4f061f1abe2ed4473a3f6 (diff)
Implemented support for software-based AUX color buffers.
Only available with Xlib driver for now. Assorted clean-ups related to Draw/ReadBuffer(). Renamed FRONT_LEFT_BIT -> DD_FRONT_LEFT_BIT, etc.
Diffstat (limited to 'src/mesa/drivers/x11/fakeglx.c')
-rw-r--r--src/mesa/drivers/x11/fakeglx.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index 4535f8cae0..47882114cf 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -252,7 +252,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
GLint depth_size, GLint stencil_size,
GLint accumRedSize, GLint accumGreenSize,
GLint accumBlueSize, GLint accumAlphaSize,
- GLint level )
+ GLint level, GLint numAuxBuffers )
{
GLboolean ximageFlag = GL_TRUE;
XMesaVisual xmvis;
@@ -287,6 +287,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
XMesaVisual v = VisualTable[i];
if (v->display == dpy
&& v->mesa_visual.level == level
+ && v->mesa_visual.numAuxBuffers == numAuxBuffers
&& v->ximage_flag == ximageFlag
&& v->mesa_visual.rgbMode == rgbFlag
&& v->mesa_visual.doubleBufferMode == dbFlag
@@ -327,6 +328,8 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
/* add xmvis to the list */
VisualTable[NumVisuals] = xmvis;
NumVisuals++;
+ /* XXX minor hack */
+ xmvis->mesa_visual.numAuxBuffers = numAuxBuffers;
}
return xmvis;
}
@@ -357,7 +360,8 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo )
0, /* depth bits */
0, /* stencil bits */
0,0,0,0, /* accum bits */
- vislevel /* level */
+ vislevel, /* level */
+ 0 /* numAux */
);
}
else if (is_usable_visual( visinfo )) {
@@ -374,7 +378,8 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo )
0 * sizeof(GLaccum), /* g */
0 * sizeof(GLaccum), /* b */
0 * sizeof(GLaccum), /* a */
- 0 /* level */
+ 0, /* level */
+ 0 /* numAux */
);
}
else {
@@ -392,7 +397,8 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo )
8 * sizeof(GLaccum), /* g */
8 * sizeof(GLaccum), /* b */
8 * sizeof(GLaccum), /* a */
- 0 /* level */
+ 0, /* level */
+ 0 /* numAux */
);
}
}
@@ -925,6 +931,7 @@ static XMesaVisual choose_visual( Display *dpy, int screen, const int *list,
GLint caveat = DONT_CARE;
XMesaVisual xmvis = NULL;
int desiredVisualID = -1;
+ int numAux = 0;
parselist = list;
@@ -957,7 +964,9 @@ static XMesaVisual choose_visual( Display *dpy, int screen, const int *list,
case GLX_AUX_BUFFERS:
/* ignore */
parselist++;
- parselist++;
+ numAux = *parselist++;
+ if (numAux > MAX_AUX_BUFFERS)
+ return NULL;
break;
case GLX_RED_SIZE:
parselist++;
@@ -1186,7 +1195,7 @@ static XMesaVisual choose_visual( Display *dpy, int screen, const int *list,
xmvis = save_glx_visual( dpy, vis, rgb_flag, alpha_flag, double_flag,
stereo_flag, depth_size, stencil_size,
accumRedSize, accumGreenSize,
- accumBlueSize, accumAlphaSize, level );
+ accumBlueSize, accumAlphaSize, level, numAux );
}
return xmvis;
@@ -1566,7 +1575,7 @@ get_config( XMesaVisual xmvis, int attrib, int *value, GLboolean fbconfig )
*value = (int) xmvis->mesa_visual.stereoMode;
return 0;
case GLX_AUX_BUFFERS:
- *value = (int) False;
+ *value = xmvis->mesa_visual.numAuxBuffers;
return 0;
case GLX_RED_SIZE:
*value = xmvis->mesa_visual.redBits;