summaryrefslogtreecommitdiff
path: root/xc/extras/Mesa/src/X/xmesa1.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/extras/Mesa/src/X/xmesa1.c')
-rw-r--r--xc/extras/Mesa/src/X/xmesa1.c80
1 files changed, 54 insertions, 26 deletions
diff --git a/xc/extras/Mesa/src/X/xmesa1.c b/xc/extras/Mesa/src/X/xmesa1.c
index 4eb5cc82b..618475d1c 100644
--- a/xc/extras/Mesa/src/X/xmesa1.c
+++ b/xc/extras/Mesa/src/X/xmesa1.c
@@ -72,6 +72,11 @@
#endif
+#ifndef GLX_NONE_EXT
+#define GLX_NONE_EXT 0x8000
+#endif
+
+
/*
* Current X/Mesa context pointer:
*/
@@ -418,7 +423,7 @@ static void free_xmesa_buffer(int client, XMesaBuffer buffer)
}
-/* Copy X color table stuff from on XMesaBuffer to another. */
+/* Copy X color table stuff from one XMesaBuffer to another. */
static void copy_colortable_info(XMesaBuffer dst, const XMesaBuffer src)
{
MEMCPY(dst->color_table, src->color_table, sizeof(src->color_table));
@@ -1408,21 +1413,29 @@ unsigned long xmesa_color_to_pixel( XMesaContext xmesa,
/*
* Create a new X/Mesa visual.
- * Input: display - the X display
- * visinfo - the XVisualInfo
- * rgb_flag - TRUE=RGB(A) mode, FALSE=CI mode
- * alpha_flag - need alpha planes?
- * db_flag - TRUE=double bufferd, FALSE=single
- * stereo_flag - true/false
- * ximage_flag - TRUE=use XImage for back buffer, FALSE=use Pixmap
- * depth_size - requested min bits per depth buffer value
- * stencil_size - requested min bits per stencil buffer value
- * accum_size - requested min bits per accum buffer value (per channel)
- * level - 0=normal, 1=overaly, -1=underlay, etc.
- * Return: New XMesaVisual or NULL if something goes wrong
+ * Input: display - X11 display
+ * visinfo - an XVisualInfo pointer
+ * rgb_flag - GL_TRUE = RGB mode,
+ * GL_FALSE = color index mode
+ * alpha_flag - alpha buffer requested?
+ * db_flag - GL_TRUE = double-buffered,
+ * GL_FALSE = single buffered
+ * stereo_flag - stereo visual?
+ * ximage_flag - GL_TRUE = use an XImage for back buffer,
+ * GL_FALSE = use an off-screen pixmap for back buffer
+ * depth_size - requested bits/depth values, or zero
+ * stencil_size - requested bits/stencil values, or zero
+ * accum_red_size - requested bits/red accum values, or zero
+ * accum_green_size - requested bits/green accum values, or zero
+ * accum_blue_size - requested bits/blue accum values, or zero
+ * accum_alpha_size - requested bits/alpha accum values, or zero
+ * num_samples - number of samples/pixel if multisampling, or zero
+ * level - visual level, usually 0
+ * visualCaveat - ala the GLX extension, usually GLX_NONE_EXT
+ * Return; a new XMesaVisual or 0 if error.
*/
XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
- XMesaVisualInfo visinfo,
+ XMesaVisualInfo visinfo,
GLboolean rgb_flag,
GLboolean alpha_flag,
GLboolean db_flag,
@@ -1430,8 +1443,13 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
GLboolean ximage_flag,
GLint depth_size,
GLint stencil_size,
- GLint accum_size,
- GLint level )
+ GLint accum_red_size,
+ GLint accum_green_size,
+ GLint accum_blue_size,
+ GLint accum_alpha_size,
+ GLint num_samples,
+ GLint level,
+ GLint visualCaveat )
{
char *gamma;
XMesaVisual v;
@@ -1506,6 +1524,7 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
v->ximage_flag = ximage_flag;
v->level = level;
+ v->VisualCaveat = visualCaveat;
(void) initialize_visual_and_buffer( 0, v, NULL, rgb_flag, 0, 0 );
@@ -1532,11 +1551,16 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display,
}
}
- v->gl_visual = gl_create_visual( rgb_flag, alpha_flag, db_flag, stereo_flag,
- depth_size, stencil_size, accum_size,
- v->index_bits,
- red_bits, green_bits,
- blue_bits, alpha_bits );
+ v->gl_visual = _mesa_create_visual( rgb_flag, alpha_flag,
+ db_flag, stereo_flag,
+ red_bits, green_bits,
+ blue_bits, alpha_bits,
+ v->index_bits,
+ depth_size,
+ stencil_size,
+ accum_red_size, accum_green_size,
+ accum_blue_size, accum_alpha_size,
+ 0 );
if (!v->gl_visual) {
#ifndef XFree86Server
FREE(v->visinfo);
@@ -1557,7 +1581,7 @@ void XMesaSetVisualDisplay( XMesaDisplay *dpy, XMesaVisual v )
void XMesaDestroyVisual( XMesaVisual v )
{
- gl_destroy_visual( v->gl_visual );
+ _mesa_destroy_visual( v->gl_visual );
#ifndef XFree86Server
FREE(v->visinfo);
#endif
@@ -1594,6 +1618,8 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list
return NULL;
}
+ gl_extensions_enable(c->gl_ctx, "GL_HP_occlusion_test");
+
if (CHECK_BYTE_ORDER(v)) {
c->swapbytes = GL_FALSE;
}
@@ -1750,7 +1776,7 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v,
b->gl_buffer = gl_create_framebuffer( v->gl_visual,
v->gl_visual->DepthBits > 0,
v->gl_visual->StencilBits > 0,
- v->gl_visual->AccumBits > 0,
+ v->gl_visual->AccumRedBits > 0,
v->gl_visual->AlphaBits > 0 );
if (!b->gl_buffer) {
free_xmesa_buffer(client, b);
@@ -1778,9 +1804,9 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v,
if (v->gl_visual->DBflag) {
attribs[numAttribs++] = FXMESA_DOUBLEBUFFER;
}
- if (v->gl_visual->AccumBits > 0) {
+ if (v->gl_visual->AccumRedBits > 0) {
attribs[numAttribs++] = FXMESA_ACCUM_SIZE;
- attribs[numAttribs++] = v->gl_visual->AccumBits;
+ attribs[numAttribs++] = v->gl_visual->AccumRedBits;
}
if (v->gl_visual->StencilBits > 0) {
attribs[numAttribs++] = FXMESA_STENCIL_SIZE;
@@ -1897,7 +1923,9 @@ XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v,
b->gl_buffer = gl_create_framebuffer( v->gl_visual,
v->gl_visual->DepthBits > 0,
v->gl_visual->StencilBits > 0,
- v->gl_visual->AccumBits > 0,
+ v->gl_visual->AccumRedBits +
+ v->gl_visual->AccumGreenBits +
+ v->gl_visual->AccumBlueBits > 0,
v->gl_visual->AlphaBits > 0 );
if (!b->gl_buffer) {
free_xmesa_buffer(client, b);