aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/get.c24
-rw-r--r--src/mesa/main/get_gen.py2
2 files changed, 26 insertions, 0 deletions
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 )
]