diff options
author | Brian Paul <[email protected]> | 2009-12-29 15:04:03 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-12-29 15:04:03 -0700 |
commit | 3728673bd1b974e54858fbab6ff62d3607b0d3f0 (patch) | |
tree | 3c66688732a9aa9133f72e79bb43ec1cda1cb66c /src/mesa/main/get.c | |
parent | 561a107df71aace22a15003cc77dd504ab8b06a0 (diff) |
mesa: per-buffer blend enabled flags
ctx->Color.BlendEnabled is now a GLbitfield instead of a GLboolean to
indicate blend on/off status for each color/draw buffer.
This is infrastructure for GL_EXT_draw_buffers2 and OpenGL 3.x
New functions include _mesa_EnableIndexed(), _mesa_DisableIndexed(), and
_mesa_IsEnabledIndexed(). The enable function corresponds to
glEnableIndexedEXT() for GL_EXT_draw_buffers2 or glEnablei() for GL3.
Note that there's quite a few tests for ctx->Color.BlendEnabled != 0 in
drivers, etc. Those tests can remain as-is since the mask will be 0 or ~0
unless GL_EXT_draw_buffers2 is enabled.
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r-- | src/mesa/main/get.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 3d32649bade..07507414d70 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -132,7 +132,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) params[0] = INT_TO_BOOLEAN(ctx->DrawBuffer->Visual.numAuxBuffers); break; case GL_BLEND: - params[0] = ctx->Color.BlendEnabled; + params[0] = (ctx->Color.BlendEnabled & 1); break; case GL_BLEND_DST: params[0] = ENUM_TO_BOOLEAN(ctx->Color.BlendDstRGB); @@ -1967,7 +1967,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) params[0] = (GLfloat)(ctx->DrawBuffer->Visual.numAuxBuffers); break; case GL_BLEND: - params[0] = BOOLEAN_TO_FLOAT(ctx->Color.BlendEnabled); + params[0] = BOOLEAN_TO_FLOAT((ctx->Color.BlendEnabled & 1)); break; case GL_BLEND_DST: params[0] = ENUM_TO_FLOAT(ctx->Color.BlendDstRGB); @@ -3802,7 +3802,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) params[0] = ctx->DrawBuffer->Visual.numAuxBuffers; break; case GL_BLEND: - params[0] = BOOLEAN_TO_INT(ctx->Color.BlendEnabled); + params[0] = BOOLEAN_TO_INT((ctx->Color.BlendEnabled & 1)); break; case GL_BLEND_DST: params[0] = ENUM_TO_INT(ctx->Color.BlendDstRGB); @@ -5638,7 +5638,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = (GLint64)(ctx->DrawBuffer->Visual.numAuxBuffers); break; case GL_BLEND: - params[0] = BOOLEAN_TO_INT64(ctx->Color.BlendEnabled); + params[0] = BOOLEAN_TO_INT64((ctx->Color.BlendEnabled & 1)); break; case GL_BLEND_DST: params[0] = ENUM_TO_INT64(ctx->Color.BlendDstRGB); |