summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>1999-11-25 17:36:48 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>1999-11-25 17:36:48 +0000
commitcea0e8e6700e871bb9bcb334cb75fbfbfcdfd702 (patch)
tree34719520e5e96ae80984096c01695b545332d736 /src/mesa/drivers
parentb6709c84722198599688a8154ea20620b207ab79 (diff)
replaced Driver.SetBuffer() with SetDrawBuffer() and SetReadBuffer()
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/glide/fxdd.c31
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c15
2 files changed, 40 insertions, 6 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index cbe63695fa..0668195797 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -242,8 +242,9 @@ static GLbitfield fxDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
}
-/* Set the buffer used in double buffering */
-static GLboolean fxDDSetBuffer(GLcontext *ctx, GLenum mode )
+/* Set the buffer used for drawing */
+/* XXX support for separate read/draw buffers hasn't been tested */
+static GLboolean fxDDSetDrawBuffer(GLcontext *ctx, GLenum mode )
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
@@ -267,6 +268,29 @@ static GLboolean fxDDSetBuffer(GLcontext *ctx, GLenum mode )
}
+/* Set the buffer used for reading */
+/* XXX support for separate read/draw buffers hasn't been tested */
+static void fxDDSetReadBuffer(GLcontext *ctx, GLframebuffer *buffer,
+ GLenum mode )
+{
+ fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
+ (void) buffer;
+
+ if (MESA_VERBOSE&VERBOSE_DRIVER) {
+ fprintf(stderr,"fxmesa: fxDDSetBuffer(%x)\n",mode);
+ }
+
+ if (mode == GL_FRONT_LEFT) {
+ fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
+ FX_grRenderBuffer(fxMesa->currentFB);
+ }
+ else if (mode == GL_BACK_LEFT) {
+ fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
+ FX_grRenderBuffer(fxMesa->currentFB);
+ }
+}
+
+
#ifdef XF86DRI
static GLboolean inClipRects(fxMesaContext fxMesa, int px, int py)
{
@@ -808,7 +832,8 @@ void fxSetupDDPointers(GLcontext *ctx)
ctx->Driver.Index=NULL;
ctx->Driver.Color=fxDDSetColor;
- ctx->Driver.SetBuffer=fxDDSetBuffer;
+ ctx->Driver.SetDrawBuffer=fxDDSetDrawBuffer;
+ ctx->Driver.SetReadBuffer=fxDDSetReadBuffer;
ctx->Driver.GetBufferSize=fxDDBufferSize;
ctx->Driver.Bitmap=fxDDDrawBitMap;
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index a0bb746d00..e5dca91250 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -1,4 +1,4 @@
-/* $Id: osmesa.c,v 1.3 1999/11/11 01:28:41 brianp Exp $ */
+/* $Id: osmesa.c,v 1.4 1999/11/25 17:37:00 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -541,7 +541,7 @@ GLboolean GLAPIENTRY OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint
-static GLboolean set_buffer( GLcontext *ctx, GLenum mode )
+static GLboolean set_draw_buffer( GLcontext *ctx, GLenum mode )
{
(void) ctx;
if (mode==GL_FRONT_LEFT) {
@@ -553,6 +553,14 @@ static GLboolean set_buffer( GLcontext *ctx, GLenum mode )
}
+static void set_read_buffer( GLcontext *ctx, GLframebuffer *buffer, GLenum mode )
+{
+ /* separate read buffer not supported */
+ ASSERT(buffer == ctx->DrawBuffer);
+ ASSERT(mode == GL_FRONT_LEFT);
+}
+
+
static void clear_index( GLcontext *ctx, GLuint index )
{
OSMesaContext osmesa = (OSMesaContext) ctx->DriverCtx;
@@ -1539,7 +1547,8 @@ static void osmesa_update_state( GLcontext *ctx )
ctx->Driver.GetString = get_string;
ctx->Driver.UpdateState = osmesa_update_state;
- ctx->Driver.SetBuffer = set_buffer;
+ ctx->Driver.SetDrawBuffer = set_draw_buffer;
+ ctx->Driver.SetReadBuffer = set_read_buffer;
ctx->Driver.Color = set_color;
ctx->Driver.Index = set_index;
ctx->Driver.ClearIndex = clear_index;