summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-03-19 00:10:22 +0000
committerBrian Paul <[email protected]>2006-03-19 00:10:22 +0000
commit21a4fb41376ab90afdfca67375e55e4a0ded6c0f (patch)
tree5880e8c34210ee5646bf8dfae3c9a6ae3520b798
parent19b05d5009f4b0e83118b351b7261bb914e33f2b (diff)
Queries of GL_READ_BUFFER and GL_DRAW_BUFFER were still returning the
pre-GL_EXT_framebuffer_object state. Now return the read/draw state stored in the framebuffer objects.
-rw-r--r--src/mesa/main/get.c36
-rw-r--r--src/mesa/main/get_gen.py12
2 files changed, 24 insertions, 24 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 89eccf36b44..7147c9a5ccc 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -312,7 +312,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
params[0] = ctx->DrawBuffer->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
- params[0] = ENUM_TO_BOOLEAN(ctx->Color.DrawBuffer[0]);
+ params[0] = ENUM_TO_BOOLEAN(ctx->DrawBuffer->ColorDrawBuffer[0]);
break;
case GL_EDGE_FLAG:
{
@@ -781,7 +781,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
params[0] = INT_TO_BOOLEAN(ctx->ProjectionMatrixStack.Depth + 1);
break;
case GL_READ_BUFFER:
- params[0] = ENUM_TO_BOOLEAN(ctx->Pixel.ReadBuffer);
+ params[0] = ENUM_TO_BOOLEAN(ctx->ReadBuffer->ColorReadBuffer);
break;
case GL_RED_BIAS:
params[0] = FLOAT_TO_BOOLEAN(ctx->Pixel.RedBias);
@@ -1743,7 +1743,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
break;
case GL_DRAW_BUFFER0_ARB:
CHECK_EXT1(ARB_draw_buffers, "GetBooleanv");
- params[0] = ENUM_TO_BOOLEAN(ctx->Color.DrawBuffer[0]);
+ params[0] = ENUM_TO_BOOLEAN(ctx->DrawBuffer->ColorDrawBuffer[0]);
break;
case GL_DRAW_BUFFER1_ARB:
CHECK_EXT1(ARB_draw_buffers, "GetBooleanv");
@@ -1753,7 +1753,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[1];
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[1];
params[0] = ENUM_TO_BOOLEAN(buffer);
}
break;
@@ -1765,7 +1765,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[2];
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[2];
params[0] = ENUM_TO_BOOLEAN(buffer);
}
break;
@@ -1777,7 +1777,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[3];
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[3];
params[0] = ENUM_TO_BOOLEAN(buffer);
}
break;
@@ -2130,7 +2130,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
params[0] = BOOLEAN_TO_FLOAT(ctx->DrawBuffer->Visual.doubleBufferMode);
break;
case GL_DRAW_BUFFER:
- params[0] = ENUM_TO_FLOAT(ctx->Color.DrawBuffer[0]);
+ params[0] = ENUM_TO_FLOAT(ctx->DrawBuffer->ColorDrawBuffer[0]);
break;
case GL_EDGE_FLAG:
{
@@ -2599,7 +2599,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
params[0] = (GLfloat)(ctx->ProjectionMatrixStack.Depth + 1);
break;
case GL_READ_BUFFER:
- params[0] = ENUM_TO_FLOAT(ctx->Pixel.ReadBuffer);
+ params[0] = ENUM_TO_FLOAT(ctx->ReadBuffer->ColorReadBuffer);
break;
case GL_RED_BIAS:
params[0] = ctx->Pixel.RedBias;
@@ -3561,7 +3561,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
break;
case GL_DRAW_BUFFER0_ARB:
CHECK_EXT1(ARB_draw_buffers, "GetFloatv");
- params[0] = ENUM_TO_FLOAT(ctx->Color.DrawBuffer[0]);
+ params[0] = ENUM_TO_FLOAT(ctx->DrawBuffer->ColorDrawBuffer[0]);
break;
case GL_DRAW_BUFFER1_ARB:
CHECK_EXT1(ARB_draw_buffers, "GetFloatv");
@@ -3571,7 +3571,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[1];
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[1];
params[0] = ENUM_TO_FLOAT(buffer);
}
break;
@@ -3583,7 +3583,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[2];
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[2];
params[0] = ENUM_TO_FLOAT(buffer);
}
break;
@@ -3595,7 +3595,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[3];
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[3];
params[0] = ENUM_TO_FLOAT(buffer);
}
break;
@@ -3948,7 +3948,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
params[0] = BOOLEAN_TO_INT(ctx->DrawBuffer->Visual.doubleBufferMode);
break;
case GL_DRAW_BUFFER:
- params[0] = ENUM_TO_INT(ctx->Color.DrawBuffer[0]);
+ params[0] = ENUM_TO_INT(ctx->DrawBuffer->ColorDrawBuffer[0]);
break;
case GL_EDGE_FLAG:
{
@@ -4417,7 +4417,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
params[0] = ctx->ProjectionMatrixStack.Depth + 1;
break;
case GL_READ_BUFFER:
- params[0] = ENUM_TO_INT(ctx->Pixel.ReadBuffer);
+ params[0] = ENUM_TO_INT(ctx->ReadBuffer->ColorReadBuffer);
break;
case GL_RED_BIAS:
params[0] = IROUND(ctx->Pixel.RedBias);
@@ -5379,7 +5379,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
break;
case GL_DRAW_BUFFER0_ARB:
CHECK_EXT1(ARB_draw_buffers, "GetIntegerv");
- params[0] = ENUM_TO_INT(ctx->Color.DrawBuffer[0]);
+ params[0] = ENUM_TO_INT(ctx->DrawBuffer->ColorDrawBuffer[0]);
break;
case GL_DRAW_BUFFER1_ARB:
CHECK_EXT1(ARB_draw_buffers, "GetIntegerv");
@@ -5389,7 +5389,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[1];
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[1];
params[0] = ENUM_TO_INT(buffer);
}
break;
@@ -5401,7 +5401,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[2];
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[2];
params[0] = ENUM_TO_INT(buffer);
}
break;
@@ -5413,7 +5413,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[3];
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[3];
params[0] = ENUM_TO_INT(buffer);
}
break;
diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py
index 9676a35872c..5b3d35fc446 100644
--- a/src/mesa/main/get_gen.py
+++ b/src/mesa/main/get_gen.py
@@ -183,7 +183,7 @@ StateVars = [
( "GL_DITHER", GLboolean, ["ctx->Color.DitherFlag"], "", None ),
( "GL_DOUBLEBUFFER", GLboolean,
["ctx->DrawBuffer->Visual.doubleBufferMode"], "", None ),
- ( "GL_DRAW_BUFFER", GLenum, ["ctx->Color.DrawBuffer[0]"], "", None ),
+ ( "GL_DRAW_BUFFER", GLenum, ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", None ),
( "GL_EDGE_FLAG", GLboolean, ["ctx->Current.EdgeFlag"],
"FLUSH_CURRENT(ctx, 0);", None ),
( "GL_FEEDBACK_BUFFER_SIZE", GLint, ["ctx->Feedback.BufferSize"], "", None ),
@@ -377,7 +377,7 @@ StateVars = [
"const GLfloat *matrix = ctx->ProjectionMatrixStack.Top->m;", None ),
( "GL_PROJECTION_STACK_DEPTH", GLint,
["ctx->ProjectionMatrixStack.Depth + 1"], "", None ),
- ( "GL_READ_BUFFER", GLenum, ["ctx->Pixel.ReadBuffer"], "", None ),
+ ( "GL_READ_BUFFER", GLenum, ["ctx->ReadBuffer->ColorReadBuffer"], "", None ),
( "GL_RED_BIAS", GLfloat, ["ctx->Pixel.RedBias"], "", None ),
( "GL_RED_BITS", GLint, [" ctx->DrawBuffer->Visual.redBits "], "", None ),
( "GL_RED_SCALE", GLfloat, ["ctx->Pixel.RedScale"], "", None ),
@@ -906,7 +906,7 @@ StateVars = [
( "GL_MAX_DRAW_BUFFERS_ARB", GLint,
["ctx->Const.MaxDrawBuffers"], "", ["ARB_draw_buffers"] ),
( "GL_DRAW_BUFFER0_ARB", GLenum,
- ["ctx->Color.DrawBuffer[0]"], "", ["ARB_draw_buffers"] ),
+ ["ctx->DrawBuffer->ColorDrawBuffer[0]"], "", ["ARB_draw_buffers"] ),
( "GL_DRAW_BUFFER1_ARB", GLenum,
["buffer"],
"""GLenum buffer;
@@ -914,7 +914,7 @@ StateVars = [
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[1];""", ["ARB_draw_buffers"] ),
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[1];""", ["ARB_draw_buffers"] ),
( "GL_DRAW_BUFFER2_ARB", GLenum,
["buffer"],
"""GLenum buffer;
@@ -922,7 +922,7 @@ StateVars = [
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[2];""", ["ARB_draw_buffers"] ),
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[2];""", ["ARB_draw_buffers"] ),
( "GL_DRAW_BUFFER3_ARB", GLenum,
["buffer"],
"""GLenum buffer;
@@ -930,7 +930,7 @@ StateVars = [
_mesa_error(ctx, GL_INVALID_ENUM, "glGet(GL_DRAW_BUFFERx_ARB)");
return;
}
- buffer = ctx->Color.DrawBuffer[3];""", ["ARB_draw_buffers"] ),
+ buffer = ctx->DrawBuffer->ColorDrawBuffer[3];""", ["ARB_draw_buffers"] ),
# XXX Add more GL_DRAW_BUFFERn_ARB entries as needed in the future
# GL_OES_read_format