summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/svga
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-07-09 01:22:50 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-07-09 01:22:50 +0000
commit3b4fbbc129c711a5aec8d653d5c6eb2e195f947c (patch)
treeececa2d3a08ab45afd2068d9cabf5609a0c374d1 /src/mesa/drivers/svga
parentb4338e58879a4f2eabf8af09f9dfa7adf6e9f9f2 (diff)
Overhaul of glRead/DrawBuffer() code. Now, swrast->Driver.SetBuffer()
indicates the read AND draw color buffer for all software rasterization. Lots of related clean-ups. See RELNOTES-4.1 for details.
Diffstat (limited to 'src/mesa/drivers/svga')
-rw-r--r--src/mesa/drivers/svga/svgamesa.c37
1 files changed, 7 insertions, 30 deletions
diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c
index 5d2e3d55a2..270455ee69 100644
--- a/src/mesa/drivers/svga/svgamesa.c
+++ b/src/mesa/drivers/svga/svgamesa.c
@@ -1,4 +1,4 @@
-/* $Id: svgamesa.c,v 1.19 2002/06/15 02:38:17 brianp Exp $ */
+/* $Id: svgamesa.c,v 1.20 2002/07/09 01:22:51 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -217,34 +217,9 @@ static void get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *heigh
*height = SVGAMesa->height = vga_getydim();
}
-static void set_draw_buffer( GLcontext *ctx, GLenum buffer )
-{
- if (buffer == GL_FRONT_LEFT) {
- SVGABuffer.DrawBuffer = SVGABuffer.FrontBuffer;
-#if 0
- /* vga_waitretrace(); */
- void * tmpptr;
- copy_buffer(SVGABuffer.FrontBuffer);
- tmpptr=SVGABuffer.BackBuffer;
- SVGABuffer.BackBuffer=SVGABuffer.FrontBuffer;
- SVGABuffer.FrontBuffer=tmpptr;
-#endif
- }
- else if (buffer == GL_BACK_LEFT) {
- SVGABuffer.DrawBuffer = SVGABuffer.BackBuffer;
-#if 0
- /* vga_waitretrace(); */
- copy_buffer(SVGABuffer.BackBuffer);
-#endif
- }
- else {
- /* nothing since we don't have any point/line/triangle functions. */
- }
-}
-
-static void set_read_buffer( GLcontext *ctx, GLframebuffer *colorBuffer,
- GLenum buffer )
+static void set_buffer( GLcontext *ctx, GLframebuffer *colorBuffer,
+ GLenum buffer )
{
/* We can ignore colorBuffer since we don't support a MakeCurrentRead()
* function.
@@ -253,6 +228,7 @@ static void set_read_buffer( GLcontext *ctx, GLframebuffer *colorBuffer,
if (buffer == GL_FRONT_LEFT) {
SVGABuffer.ReadBuffer = SVGABuffer.FrontBuffer;
+ SVGABuffer.DrawBuffer = SVGABuffer.FrontBuffer;
#if 0
void * tmpptr;
/* vga_waitretrace(); */
@@ -264,6 +240,7 @@ static void set_read_buffer( GLcontext *ctx, GLframebuffer *colorBuffer,
}
else if (buffer == GL_BACK_LEFT) {
SVGABuffer.ReadBuffer = SVGABuffer.BackBuffer;
+ SVGABuffer.DrawBuffer = SVGABuffer.BackBuffer;
#if 0
/* vga_waitretrace(); */
copy_buffer(SVGABuffer.BackBuffer);
@@ -285,7 +262,6 @@ static void svgamesa_update_state( GLcontext *ctx, GLuint new_state )
ctx->Driver.UpdateState = svgamesa_update_state;
ctx->Driver.GetBufferSize = get_buffer_size;
- ctx->Driver.SetDrawBuffer = set_draw_buffer;
ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
/* Software rasterizer pixel paths:
@@ -295,10 +271,11 @@ static void svgamesa_update_state( GLcontext *ctx, GLuint new_state )
ctx->Driver.CopyPixels = _swrast_CopyPixels;
ctx->Driver.DrawPixels = _swrast_DrawPixels;
ctx->Driver.ReadPixels = _swrast_ReadPixels;
+ ctx->Driver.DrawBuffer = _swrast_DrawBuffer;
/* Fill in the swrast driver interface:
*/
- swdd->SetReadBuffer = set_read_buffer;
+ swdd->SetBuffer = set_buffer;
switch (SVGABuffer.Depth) {
case 8: ctx->Driver.ClearIndex = __clear_index8;