summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-02-08 23:52:29 +0000
committerBrian Paul <[email protected]>2001-02-08 23:52:29 +0000
commit9db3f95acea5622573803890afd506ebcdaab3b3 (patch)
tree3e93e33ca60e54845d3cad5aedec325cb6bc75e2
parent1f12a07380e8cd4165d94c33661f1ada31f22222 (diff)
fixed bytesPerValue bug in OSMesaGetDepthBuffer()
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 2656b5531d8..0c9cc416cf0 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -1,4 +1,4 @@
-/* $Id: osmesa.c,v 1.44 2001/02/06 21:42:49 brianp Exp $ */
+/* $Id: osmesa.c,v 1.45 2001/02/08 23:52:29 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -542,7 +542,10 @@ OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height,
else {
*width = c->gl_buffer->Width;
*height = c->gl_buffer->Height;
- *bytesPerValue = sizeof(GLdepth);
+ if (c->gl_visual->depthBits <= 16)
+ *bytesPerValue = sizeof(GLushort);
+ else
+ *bytesPerValue = sizeof(GLuint);
*buffer = c->gl_buffer->DepthBuffer;
return GL_TRUE;
}