summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_buffers.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-10-02 16:39:09 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-10-02 16:39:09 +0000
commit53f82c5aadbb15585754bfacf3237093eccdb2ce (patch)
tree93c013f62d99caf8581c774f768cb7f365350095 /src/mesa/swrast/s_buffers.c
parent289ffee2a017308a9a97689662293613dc62d9e9 (diff)
added support for GL_ARB_draw_buffers
Diffstat (limited to 'src/mesa/swrast/s_buffers.c')
-rw-r--r--src/mesa/swrast/s_buffers.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c
index 26b4f902e1..d05c8dfbf9 100644
--- a/src/mesa/swrast/s_buffers.c
+++ b/src/mesa/swrast/s_buffers.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 6.3
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
@@ -147,7 +147,7 @@ clear_color_buffers(GLcontext *ctx)
/* loop over four possible dest color buffers */
for (bufferBit = 1; bufferBit <= DD_AUX3_BIT; bufferBit <<= 1) {
- if (bufferBit & ctx->Color._DrawDestMask) {
+ if (bufferBit & ctx->Color._DrawDestMask[0]) {
(*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit);
if (colorMask != 0xffffffff) {
@@ -199,7 +199,7 @@ _swrast_Clear( GLcontext *ctx, GLbitfield mask,
/* do software clearing here */
if (mask) {
- if (mask & ctx->Color._DrawDestMask) {
+ if (mask & ctx->Color._DrawDestMask[0]) {
clear_color_buffers(ctx);
/* clear software-based alpha buffer(s) */
if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
@@ -261,6 +261,16 @@ _swrast_DrawBuffer( GLcontext *ctx, GLenum mode )
/*
+ * Fallback for ctx->Driver.DrawBuffers()
+ */
+void
+_swrast_DrawBuffers( GLcontext *ctx, GLsizei n, const GLenum *buffers )
+{
+ _swrast_use_draw_buffer(ctx);
+}
+
+
+/*
* Setup things so that we read/write spans from the user-designated
* read buffer (set via glReadPixels). We usually just have to call
* this for glReadPixels, glCopyPixels, etc.
@@ -297,21 +307,21 @@ _swrast_use_draw_buffer( GLcontext *ctx )
* we loop over multiple color buffers when needed.
*/
- if (ctx->Color._DrawDestMask & DD_FRONT_LEFT_BIT)
+ if (ctx->Color._DrawDestMask[0] & DD_FRONT_LEFT_BIT)
swrast->CurrentBufferBit = DD_FRONT_LEFT_BIT;
- else if (ctx->Color._DrawDestMask & DD_BACK_LEFT_BIT)
+ else if (ctx->Color._DrawDestMask[0] & DD_BACK_LEFT_BIT)
swrast->CurrentBufferBit = DD_BACK_LEFT_BIT;
- else if (ctx->Color._DrawDestMask & DD_FRONT_RIGHT_BIT)
+ else if (ctx->Color._DrawDestMask[0] & DD_FRONT_RIGHT_BIT)
swrast->CurrentBufferBit = DD_FRONT_RIGHT_BIT;
- else if (ctx->Color._DrawDestMask & DD_BACK_RIGHT_BIT)
+ else if (ctx->Color._DrawDestMask[0] & DD_BACK_RIGHT_BIT)
swrast->CurrentBufferBit = DD_BACK_RIGHT_BIT;
- else if (ctx->Color._DrawDestMask & DD_AUX0_BIT)
+ else if (ctx->Color._DrawDestMask[0] & DD_AUX0_BIT)
swrast->CurrentBufferBit = DD_AUX0_BIT;
- else if (ctx->Color._DrawDestMask & DD_AUX1_BIT)
+ else if (ctx->Color._DrawDestMask[0] & DD_AUX1_BIT)
swrast->CurrentBufferBit = DD_AUX1_BIT;
- else if (ctx->Color._DrawDestMask & DD_AUX2_BIT)
+ else if (ctx->Color._DrawDestMask[0] & DD_AUX2_BIT)
swrast->CurrentBufferBit = DD_AUX2_BIT;
- else if (ctx->Color._DrawDestMask & DD_AUX3_BIT)
+ else if (ctx->Color._DrawDestMask[0] & DD_AUX3_BIT)
swrast->CurrentBufferBit = DD_AUX3_BIT;
else
/* glDrawBuffer(GL_NONE) */