diff options
author | Brian Paul <brianp@vmware.com> | 2010-01-05 21:24:48 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-01-05 21:24:48 -0700 |
commit | d4f2d6556ec0bdaf7ef07fd34fa5d8a355fe2ec0 (patch) | |
tree | b5b9621751e9dd69510f83d5bee3758b11feefd8 | |
parent | 3510a1b0c5398b4fce4157d5b578344d2a0bd7d3 (diff) |
mesa: added GL_MAJOR_VERSION and GL_MINOR_VERSION queries
New in GL 3.0.
-rw-r--r-- | src/mesa/main/get.c | 24 | ||||
-rw-r--r-- | src/mesa/main/get_gen.py | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 618b5411cc..22cf75f79d 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1902,6 +1902,12 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) case GL_NUM_EXTENSIONS: params[0] = INT_TO_BOOLEAN(_mesa_get_extension_count(ctx)); break; + case GL_MAJOR_VERSION: + params[0] = INT_TO_BOOLEAN(ctx->VersionMajor); + break; + case GL_MINOR_VERSION: + params[0] = INT_TO_BOOLEAN(ctx->VersionMinor); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname); } @@ -3740,6 +3746,12 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) case GL_NUM_EXTENSIONS: params[0] = (GLfloat)(_mesa_get_extension_count(ctx)); break; + case GL_MAJOR_VERSION: + params[0] = (GLfloat)(ctx->VersionMajor); + break; + case GL_MINOR_VERSION: + params[0] = (GLfloat)(ctx->VersionMinor); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(pname=0x%x)", pname); } @@ -5578,6 +5590,12 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) case GL_NUM_EXTENSIONS: params[0] = _mesa_get_extension_count(ctx); break; + case GL_MAJOR_VERSION: + params[0] = ctx->VersionMajor; + break; + case GL_MINOR_VERSION: + params[0] = ctx->VersionMinor; + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname); } @@ -7417,6 +7435,12 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) case GL_NUM_EXTENSIONS: params[0] = (GLint64)(_mesa_get_extension_count(ctx)); break; + case GL_MAJOR_VERSION: + params[0] = (GLint64)(ctx->VersionMajor); + break; + case GL_MINOR_VERSION: + params[0] = (GLint64)(ctx->VersionMinor); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetInteger64v(pname=0x%x)", pname); } diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 7540661187..b0beb59207 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -1033,6 +1033,8 @@ StateVars = [ # GL3 ( "GL_NUM_EXTENSIONS", GLint, ["_mesa_get_extension_count(ctx)"], "", None ), + ( "GL_MAJOR_VERSION", GLint, ["ctx->VersionMajor"], "", None ), + ( "GL_MINOR_VERSION", GLint, ["ctx->VersionMinor"], "", None ) ] |