replaced Driver.SetBuffer() with SetDrawBuffer() and SetReadBuffer()
This commit is contained in:
@@ -242,8 +242,9 @@ static GLbitfield fxDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Set the buffer used in double buffering */
|
/* Set the buffer used for drawing */
|
||||||
static GLboolean fxDDSetBuffer(GLcontext *ctx, GLenum mode )
|
/* XXX support for separate read/draw buffers hasn't been tested */
|
||||||
|
static GLboolean fxDDSetDrawBuffer(GLcontext *ctx, GLenum mode )
|
||||||
{
|
{
|
||||||
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
|
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
|
#ifdef XF86DRI
|
||||||
static GLboolean inClipRects(fxMesaContext fxMesa, int px, int py)
|
static GLboolean inClipRects(fxMesaContext fxMesa, int px, int py)
|
||||||
{
|
{
|
||||||
@@ -808,7 +832,8 @@ void fxSetupDDPointers(GLcontext *ctx)
|
|||||||
ctx->Driver.Index=NULL;
|
ctx->Driver.Index=NULL;
|
||||||
ctx->Driver.Color=fxDDSetColor;
|
ctx->Driver.Color=fxDDSetColor;
|
||||||
|
|
||||||
ctx->Driver.SetBuffer=fxDDSetBuffer;
|
ctx->Driver.SetDrawBuffer=fxDDSetDrawBuffer;
|
||||||
|
ctx->Driver.SetReadBuffer=fxDDSetReadBuffer;
|
||||||
ctx->Driver.GetBufferSize=fxDDBufferSize;
|
ctx->Driver.GetBufferSize=fxDDBufferSize;
|
||||||
|
|
||||||
ctx->Driver.Bitmap=fxDDDrawBitMap;
|
ctx->Driver.Bitmap=fxDDDrawBitMap;
|
||||||
|
@@ -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
|
* 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;
|
(void) ctx;
|
||||||
if (mode==GL_FRONT_LEFT) {
|
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 )
|
static void clear_index( GLcontext *ctx, GLuint index )
|
||||||
{
|
{
|
||||||
OSMesaContext osmesa = (OSMesaContext) ctx->DriverCtx;
|
OSMesaContext osmesa = (OSMesaContext) ctx->DriverCtx;
|
||||||
@@ -1539,7 +1547,8 @@ static void osmesa_update_state( GLcontext *ctx )
|
|||||||
ctx->Driver.GetString = get_string;
|
ctx->Driver.GetString = get_string;
|
||||||
ctx->Driver.UpdateState = osmesa_update_state;
|
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.Color = set_color;
|
||||||
ctx->Driver.Index = set_index;
|
ctx->Driver.Index = set_index;
|
||||||
ctx->Driver.ClearIndex = clear_index;
|
ctx->Driver.ClearIndex = clear_index;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: accum.c,v 1.12 1999/11/24 18:48:30 brianp Exp $ */
|
/* $Id: accum.c,v 1.13 1999/11/25 17:36:48 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -221,7 +221,8 @@ _mesa_Accum( GLenum op, GLfloat value )
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_ACCUM:
|
case GL_ACCUM:
|
||||||
(void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
|
(*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
|
||||||
|
ctx->Pixel.DriverReadBuffer );
|
||||||
|
|
||||||
/* May have to leave optimized accum buffer mode */
|
/* May have to leave optimized accum buffer mode */
|
||||||
if (ctx->IntegerAccumScaler == 0.0 && value > 0.0 && value <= 1.0)
|
if (ctx->IntegerAccumScaler == 0.0 && value > 0.0 && value <= 1.0)
|
||||||
@@ -269,11 +270,14 @@ _mesa_Accum( GLenum op, GLfloat value )
|
|||||||
ypos++;
|
ypos++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
|
/* restore read buffer = draw buffer (the default) */
|
||||||
|
(*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
|
||||||
|
ctx->Color.DriverDrawBuffer );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_LOAD:
|
case GL_LOAD:
|
||||||
(void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
|
(*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
|
||||||
|
ctx->Pixel.DriverReadBuffer );
|
||||||
|
|
||||||
/* This is a change to go into optimized accum buffer mode */
|
/* This is a change to go into optimized accum buffer mode */
|
||||||
if (value > 0.0 && value <= 1.0) {
|
if (value > 0.0 && value <= 1.0) {
|
||||||
@@ -328,7 +332,10 @@ _mesa_Accum( GLenum op, GLfloat value )
|
|||||||
ypos++;
|
ypos++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
|
|
||||||
|
/* restore read buffer = draw buffer (the default) */
|
||||||
|
(*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
|
||||||
|
ctx->Color.DriverDrawBuffer );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_RETURN:
|
case GL_RETURN:
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: dd.h,v 1.5 1999/11/22 21:54:14 brianp Exp $ */
|
/* $Id: dd.h,v 1.6 1999/11/25 17:36:48 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -180,9 +180,9 @@ struct dd_function_table {
|
|||||||
* This color should also be used in the "mono" drawing functions.
|
* This color should also be used in the "mono" drawing functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GLboolean (*SetBuffer)( GLcontext *ctx, GLenum buffer );
|
GLboolean (*SetDrawBuffer)( GLcontext *ctx, GLenum buffer );
|
||||||
/*
|
/*
|
||||||
* Selects the color buffer(s) for reading and writing.
|
* Specifies the current buffer for writing.
|
||||||
* The following values must be accepted when applicable:
|
* The following values must be accepted when applicable:
|
||||||
* GL_FRONT_LEFT - this buffer always exists
|
* GL_FRONT_LEFT - this buffer always exists
|
||||||
* GL_BACK_LEFT - when double buffering
|
* GL_BACK_LEFT - when double buffering
|
||||||
@@ -200,6 +200,17 @@ struct dd_function_table {
|
|||||||
* GL_NONE - disable buffer write in device driver.
|
* GL_NONE - disable buffer write in device driver.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void (*SetReadBuffer)( GLcontext *ctx, GLframebuffer *colorBuffer,
|
||||||
|
GLenum buffer );
|
||||||
|
/*
|
||||||
|
* Specifies the current buffer for reading.
|
||||||
|
* colorBuffer will be one of:
|
||||||
|
* GL_FRONT_LEFT - this buffer always exists
|
||||||
|
* GL_BACK_LEFT - when double buffering
|
||||||
|
* GL_FRONT_RIGHT - when using stereo
|
||||||
|
* GL_BACK_RIGHT - when using stereo and double buffering
|
||||||
|
*/
|
||||||
|
|
||||||
void (*GetBufferSize)( GLcontext *ctx, GLuint *width, GLuint *height );
|
void (*GetBufferSize)( GLcontext *ctx, GLuint *width, GLuint *height );
|
||||||
/*
|
/*
|
||||||
* Returns the width and height of the current color buffer.
|
* Returns the width and height of the current color buffer.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: teximage.c,v 1.13 1999/11/24 18:48:31 brianp Exp $ */
|
/* $Id: teximage.c,v 1.14 1999/11/25 17:36:48 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
@@ -1627,7 +1627,8 @@ read_color_image( GLcontext *ctx, GLint x, GLint y,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Select buffer to read from */
|
/* Select buffer to read from */
|
||||||
(void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
|
(*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
|
||||||
|
ctx->Pixel.DriverReadBuffer );
|
||||||
|
|
||||||
dst = image;
|
dst = image;
|
||||||
stride = width * 4 * sizeof(GLubyte);
|
stride = width * 4 * sizeof(GLubyte);
|
||||||
@@ -1637,8 +1638,9 @@ read_color_image( GLcontext *ctx, GLint x, GLint y,
|
|||||||
dst += stride;
|
dst += stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore drawing buffer */
|
/* Read from draw buffer (the default) */
|
||||||
(void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
|
(*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
|
||||||
|
ctx->Color.DriverDrawBuffer );
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
@@ -1728,7 +1730,8 @@ copy_tex_sub_image( GLcontext *ctx, struct gl_texture_image *dest,
|
|||||||
components = components_in_intformat( format );
|
components = components_in_intformat( format );
|
||||||
|
|
||||||
/* Select buffer to read from */
|
/* Select buffer to read from */
|
||||||
(void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.DriverReadBuffer );
|
(*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
|
||||||
|
ctx->Pixel.DriverReadBuffer );
|
||||||
|
|
||||||
for (i = 0;i < height; i++) {
|
for (i = 0;i < height; i++) {
|
||||||
GLubyte rgba[MAX_WIDTH][4];
|
GLubyte rgba[MAX_WIDTH][4];
|
||||||
@@ -1740,8 +1743,9 @@ copy_tex_sub_image( GLcontext *ctx, struct gl_texture_image *dest,
|
|||||||
&packing, GL_TRUE);
|
&packing, GL_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore drawing buffer */
|
/* Read from draw buffer (the default) */
|
||||||
(void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DriverDrawBuffer );
|
(*ctx->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer,
|
||||||
|
ctx->Color.DriverDrawBuffer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user