diff options
author | Brian Paul <[email protected]> | 2009-12-29 15:09:16 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-12-29 15:09:16 -0700 |
commit | 126b35bd3acbf486471879531cd2e6f446b14497 (patch) | |
tree | e3997a0718682a4968525e7f0801c01d0ee0bffa /src/mesa/main/get.c | |
parent | 3728673bd1b974e54858fbab6ff62d3607b0d3f0 (diff) |
mesa: implement indexed glGet functions
The functions are _mesa_GetBooleanIndexedv(), _mesa_GetIntegerIndexedv(), and
_mesa_GetInteger64Indexedv(). These will be called from API functions such as
glGetBooleanIndexedvEXT() and glGetBooleani_v().
Only the GL_BLEND query is supported at this time.
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r-- | src/mesa/main/get.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 07507414d70..aff67466bcb 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -7434,3 +7434,77 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) params[i] = (GLdouble) values[i]; } +void GLAPIENTRY +_mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (!params) + return; + + if (ctx->NewState) + _mesa_update_state(ctx); + + switch (pname) { + case GL_BLEND: + if (index >= MAX_DRAW_BUFFERS) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGetBooleanIndexedv(index=%u), index", pname); + } + params[0] = INT_TO_BOOLEAN(((ctx->Color.BlendEnabled >> index) & 1)); + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanIndexedv(pname=0x%x)", pname); + } +} + +void GLAPIENTRY +_mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (!params) + return; + + if (ctx->NewState) + _mesa_update_state(ctx); + + switch (pname) { + case GL_BLEND: + if (index >= MAX_DRAW_BUFFERS) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGetIntegerIndexedv(index=%u), index", pname); + } + params[0] = ((ctx->Color.BlendEnabled >> index) & 1); + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerIndexedv(pname=0x%x)", pname); + } +} + +#if FEATURE_ARB_sync +void GLAPIENTRY +_mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (!params) + return; + + if (ctx->NewState) + _mesa_update_state(ctx); + + switch (pname) { + case GL_BLEND: + if (index >= MAX_DRAW_BUFFERS) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGetInteger64Indexedv(index=%u), index", pname); + } + params[0] = (GLint64)(((ctx->Color.BlendEnabled >> index) & 1)); + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glGetInteger64Indexedv(pname=0x%x)", pname); + } +} +#endif /* FEATURE_ARB_sync */ + |