aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11/xm_api.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-10-05 18:27:41 +0000
committerBrian Paul <[email protected]>2002-10-05 18:27:41 +0000
commite4656003caee346d9c4eb23256d73409271291a7 (patch)
tree14026ab43b841752e86aff9749984874b0b3cb34 /src/mesa/drivers/x11/xm_api.c
parentfa647e8336767654e1f67729b7eca61fbf76ff41 (diff)
Pbuffers seem to work!
Diffstat (limited to 'src/mesa/drivers/x11/xm_api.c')
-rw-r--r--src/mesa/drivers/x11/xm_api.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 4f34e2b6a8f..708e2a8a819 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.42 2002/10/05 03:02:34 brianp Exp $ */
+/* $Id: xm_api.c,v 1.43 2002/10/05 18:27:41 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -628,9 +628,7 @@ void xmesa_alloc_back_buffer( XMesaBuffer b )
b->backimage = XMesaCreateImage(b->xm_visual->BitsPerPixel,
b->width, b->height, NULL);
#else
- if (b->shm==0
- || alloc_shm_back_buffer(b)==GL_FALSE
- ) {
+ if (b->shm==0 || alloc_shm_back_buffer(b)==GL_FALSE) {
/* Allocate a regular XImage for the back buffer. */
b->backimage = XCreateImage( b->xm_visual->display,
b->xm_visual->visinfo->visual,
@@ -1932,9 +1930,10 @@ XMesaBuffer XMesaCreatePBuffer( XMesaVisual v, XMesaColormap cmap,
unsigned int width, unsigned int height )
{
int client = 0;
+ XMesaWindow root;
+ XMesaDrawable drawable; /* X Pixmap Drawable */
XMesaBuffer b = alloc_xmesa_buffer();
if (!b) {
- printf("return NULL 1\n");
return NULL;
}
@@ -1943,6 +1942,10 @@ XMesaBuffer XMesaCreatePBuffer( XMesaVisual v, XMesaColormap cmap,
b->display = v->display;
b->cmap = cmap;
+ /* allocate pixmap for front buffer */
+ root = RootWindow( v->display, v->visinfo->screen );
+ drawable = XCreatePixmap( v->display, root, width, height, v->visinfo->depth );
+
/* determine back buffer implementation */
if (v->mesa_visual.doubleBufferMode) {
if (v->ximage_flag) {
@@ -1966,9 +1969,8 @@ XMesaBuffer XMesaCreatePBuffer( XMesaVisual v, XMesaColormap cmap,
v->mesa_visual.alphaBits > 0 );
if (!initialize_visual_and_buffer(client, v, b, v->mesa_visual.rgbMode,
- 0, cmap)) {
+ drawable, cmap)) {
free_xmesa_buffer(client, b);
- printf("return NULL\n");
return NULL;
}