summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11/xm_buffer.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-03-30 16:33:35 +0000
committerBrian Paul <[email protected]>2006-03-30 16:33:35 +0000
commit9e81d6ae3a6db9831d6aea0fe4d92722176e9f74 (patch)
treefa81a73c9356c0add97e8339960258b8a2653076 /src/mesa/drivers/x11/xm_buffer.c
parent94d6bf883b3c2bfa52e178aa8abf5929ff524949 (diff)
When creating front/back renderbuffers, init the Red/Green/Blue/AlphaBits fields
Diffstat (limited to 'src/mesa/drivers/x11/xm_buffer.c')
-rw-r--r--src/mesa/drivers/x11/xm_buffer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c
index 8067b648407..2f20b162a7f 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -107,7 +107,7 @@ xmesa_alloc_back_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
struct xmesa_renderbuffer *
-xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, GLboolean rgbMode,
+xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, const GLvisual *visual,
GLboolean backBuffer)
{
struct xmesa_renderbuffer *xrb = CALLOC_STRUCT(xmesa_renderbuffer);
@@ -121,15 +121,20 @@ xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, GLboolean rgbMode,
else
xrb->Base.AllocStorage = xmesa_alloc_front_storage;
- if (rgbMode) {
+ if (visual->rgbMode) {
xrb->Base.InternalFormat = GL_RGBA;
xrb->Base._BaseFormat = GL_RGBA;
xrb->Base.DataType = GL_UNSIGNED_BYTE;
+ xrb->Base.RedBits = visual->redBits;
+ xrb->Base.GreenBits = visual->greenBits;
+ xrb->Base.BlueBits = visual->blueBits;
+ xrb->Base.AlphaBits = visual->alphaBits;
}
else {
xrb->Base.InternalFormat = GL_COLOR_INDEX;
xrb->Base._BaseFormat = GL_COLOR_INDEX;
xrb->Base.DataType = GL_UNSIGNED_INT;
+ xrb->Base.IndexBits = visual->indexBits;
}
/* only need to set Red/Green/EtcBits fields for user-created RBs */
}