From: Brian Paul Date: Wed, 6 Jan 2010 04:24:48 +0000 (-0700) Subject: mesa: added GL_MAJOR_VERSION and GL_MINOR_VERSION queries X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d4f2d6556ec0bdaf7ef07fd34fa5d8a355fe2ec0;p=mesa.git mesa: added GL_MAJOR_VERSION and GL_MINOR_VERSION queries New in GL 3.0. --- diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 618b5411cc9..22cf75f79de 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 7540661187f..b0beb592075 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 ) ]