aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-09-01 20:27:31 +0000
committerBrian Paul <[email protected]>2001-09-01 20:27:31 +0000
commit190d34874cdf2a074364980d1cf2d3fa201ac7a1 (patch)
treefe123fa242bb17cb7f5f808b56f4c64c5d9d18ca
parent62f75054cbf35d632b30765421f474dbec178e1f (diff)
minor changes, prototype Pbuffer support
-rw-r--r--src/mesa/drivers/x11/xm_api.c58
1 files changed, 54 insertions, 4 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index f80a7a70bde..9fdcf0d2faa 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -1,4 +1,4 @@
-/* $Id: xm_api.c,v 1.27 2001/08/31 04:30:14 brianp Exp $ */
+/* $Id: xm_api.c,v 1.28 2001/09/01 20:27:31 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1030,11 +1030,10 @@ static void setup_8bit_hpcr( XMesaVisual v )
* Setup RGB rendering for a window with a True/DirectColor visual.
*/
static void setup_truecolor( XMesaVisual v, XMesaBuffer buffer,
- XMesaWindow window, XMesaColormap cmap )
+ XMesaColormap cmap )
{
unsigned long rmask, gmask, bmask;
(void) buffer;
- (void) window;
(void) cmap;
/* Compute red multiplier (mask) and bit shift */
@@ -1227,7 +1226,7 @@ static GLboolean initialize_visual_and_buffer( int client,
int xclass;
xclass = GET_VISUAL_CLASS(v);
if (xclass==TrueColor || xclass==DirectColor) {
- setup_truecolor( v, b, (XMesaWindow)window, cmap );
+ setup_truecolor( v, b, cmap );
}
else if (xclass==StaticGray && GET_VISUAL_DEPTH(v)==1) {
setup_monochrome( v, b );
@@ -1961,6 +1960,57 @@ XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v,
+#if 0 /* not done */
+XMesaBuffer XMesaCreatePBuffer( XMesaVisual v, XMesaColormap cmap,
+ unsigned int width, unsigned int height )
+{
+ int client = 0;
+ XMesaBuffer b = alloc_xmesa_buffer();
+ if (!b) {
+ return NULL;
+ }
+
+ b->xm_context = NULL; /* Associate no context with this buffer */
+
+ b->xm_visual = v;
+ b->pbuffer_flag = GL_TRUE;
+ b->display = v->display;
+ b->cmap = cmap;
+
+ /* determine back buffer implementation */
+ if (v->mesa_visual.doubleBufferMode) {
+ if (v->ximage_flag) {
+ b->db_state = BACK_XIMAGE;
+ }
+ else {
+ b->db_state = BACK_PIXMAP;
+ }
+ }
+ else {
+ b->db_state = 0;
+ }
+
+ _mesa_initialize_framebuffer(&b->mesa_buffer,
+ &v->mesa_visual,
+ v->mesa_visual.depthBits > 0,
+ v->mesa_visual.stencilBits > 0,
+ v->mesa_visual.accumRedBits +
+ v->mesa_visual.accumGreenBits +
+ v->mesa_visual.accumBlueBits > 0,
+ v->mesa_visual.alphaBits > 0 );
+
+ if (!initialize_visual_and_buffer(client, v, b, v->mesa_visual.rgbMode,
+ 0, cmap)) {
+ free_xmesa_buffer(client, b);
+ return NULL;
+ }
+
+ return b;
+}
+#endif
+
+
+
/*
* Deallocate an XMesaBuffer structure and all related info.
*/