summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-09-28 15:46:46 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-09-28 15:46:46 +0000
commitd95000da2fdad78f25618fe9703f23806587b65a (patch)
treefde04f3dcf282100056d1400ae3e269dc90a46e4 /src/mesa
parentf7a8d8ffbb1f08ed4ffef9759c98d8d7e13b4ef0 (diff)
check for framebuffer completeness, code clean-up
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/accum.c29
-rw-r--r--src/mesa/main/framebuffer.c1
2 files changed, 11 insertions, 19 deletions
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c
index 7682176183..a659e8dbdd 100644
--- a/src/mesa/main/accum.c
+++ b/src/mesa/main/accum.c
@@ -55,7 +55,6 @@ void GLAPIENTRY
_mesa_Accum( GLenum op, GLfloat value )
{
GET_CURRENT_CONTEXT(ctx);
- GLuint xpos, ypos, width, height;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
switch (op) {
@@ -84,29 +83,21 @@ _mesa_Accum( GLenum op, GLfloat value )
}
if (ctx->NewState)
- _mesa_update_state( ctx );
+ _mesa_update_state(ctx);
- if (ctx->RenderMode != GL_RENDER) {
- /* no-op */
+ if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glAccum(incomplete framebuffer)");
return;
}
- /* Determine region to operate upon. */
- if (ctx->Scissor.Enabled) {
- xpos = ctx->Scissor.X;
- ypos = ctx->Scissor.Y;
- width = ctx->Scissor.Width;
- height = ctx->Scissor.Height;
+ if (ctx->RenderMode == GL_RENDER) {
+ GLint x = ctx->DrawBuffer->_Xmin;
+ GLint y = ctx->DrawBuffer->_Ymin;
+ GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
+ GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
+ ctx->Driver.Accum(ctx, op, value, x, y, width, height);
}
- else {
- /* whole window */
- xpos = 0;
- ypos = 0;
- width = ctx->DrawBuffer->Width;
- height = ctx->DrawBuffer->Height;
- }
-
- ctx->Driver.Accum( ctx, op, value, xpos, ypos, width, height );
}
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index e2cb009ff1..5fd264eae6 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -144,6 +144,7 @@ _mesa_initialize_framebuffer(struct gl_framebuffer *fb, const GLvisual *visual)
}
fb->Delete = _mesa_destroy_framebuffer;
+ fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT;
compute_depth_max(fb);
}