diff options
author | Keith Whitwell <[email protected]> | 2001-03-19 02:25:35 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2001-03-19 02:25:35 +0000 |
commit | 709892459922a32096fe9dd8261d0d92337bb02f (patch) | |
tree | 87782215d4531207c97b236a5dfa0d15c45aef8a /src/mesa/drivers/glide/fxddspan.c | |
parent | d9bf6ccce9f5fea22d6a478c4afafea3c3c525c5 (diff) |
Split driver struct into swrast/tnl/core components.
Diffstat (limited to 'src/mesa/drivers/glide/fxddspan.c')
-rw-r--r-- | src/mesa/drivers/glide/fxddspan.c | 60 |
1 files changed, 42 insertions, 18 deletions
diff --git a/src/mesa/drivers/glide/fxddspan.c b/src/mesa/drivers/glide/fxddspan.c index e02e792deac..6d59e96f462 100644 --- a/src/mesa/drivers/glide/fxddspan.c +++ b/src/mesa/drivers/glide/fxddspan.c @@ -52,6 +52,7 @@ #if defined(FX) #include "fxdrv.h" +#include "swrast/swrast.h" #ifdef _MSC_VER #ifdef _WIN32 @@ -542,31 +543,54 @@ fxDDReadDepthPixels(GLcontext * ctx, GLuint n, +/* 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", (int) 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); + } +} + /************************************************************************/ + void fxSetupDDSpanPointers(GLcontext * ctx) { - ctx->Driver.WriteRGBASpan = fxDDWriteRGBASpan; - ctx->Driver.WriteRGBSpan = fxDDWriteRGBSpan; - ctx->Driver.WriteMonoRGBASpan = fxDDWriteMonoRGBASpan; - ctx->Driver.WriteRGBAPixels = fxDDWriteRGBAPixels; - ctx->Driver.WriteMonoRGBAPixels = fxDDWriteMonoRGBAPixels; - - ctx->Driver.WriteCI8Span = NULL; - ctx->Driver.WriteCI32Span = NULL; - ctx->Driver.WriteMonoCISpan = NULL; - ctx->Driver.WriteCI32Pixels = NULL; - ctx->Driver.WriteMonoCIPixels = NULL; - - /* ctx->Driver.ReadRGBASpan =fxDDReadRGBASpan; */ - ctx->Driver.ReadRGBASpan = read_R5G6B5_span; - ctx->Driver.ReadRGBAPixels = read_R5G6B5_pixels; - - ctx->Driver.ReadCI32Span = NULL; - ctx->Driver.ReadCI32Pixels = NULL; + struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); + + swdd->SetReadBuffer = fxDDSetReadBuffer; + + swdd->WriteRGBASpan = fxDDWriteRGBASpan; + swdd->WriteRGBSpan = fxDDWriteRGBSpan; + swdd->WriteMonoRGBASpan = fxDDWriteMonoRGBASpan; + swdd->WriteRGBAPixels = fxDDWriteRGBAPixels; + swdd->WriteMonoRGBAPixels = fxDDWriteMonoRGBAPixels; + + swdd->WriteDepthSpan = fxDDWriteDepthSpan; + swdd->WriteDepthPixels = fxDDWriteDepthPixels; + swdd->ReadDepthSpan = fxDDReadDepthSpan; + swdd->ReadDepthPixels = fxDDReadDepthPixels; + + /* swdd->ReadRGBASpan =fxDDReadRGBASpan; */ + swdd->ReadRGBASpan = read_R5G6B5_span; + swdd->ReadRGBAPixels = read_R5G6B5_pixels; } |