Mesa (master): mesa: added GL_MAJOR_VERSION and GL_MINOR_VERSION queries
Brian Paul
brianp at kemper.freedesktop.org
Wed Jan 6 04:31:00 UTC 2010
Module: Mesa
Branch: master
Commit: d4f2d6556ec0bdaf7ef07fd34fa5d8a355fe2ec0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d4f2d6556ec0bdaf7ef07fd34fa5d8a355fe2ec0
Author: Brian Paul <brianp at vmware.com>
Date: Tue Jan 5 21:24:48 2010 -0700
mesa: added GL_MAJOR_VERSION and GL_MINOR_VERSION queries
New in GL 3.0.
---
src/mesa/main/get.c | 24 ++++++++++++++++++++++++
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 618b541..22cf75f 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 7540661..b0beb59 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 )
]
More information about the mesa-commit
mailing list