From 00225af999acabcd5eced0b075b0a56018fd5eb8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 20 Mar 2010 11:50:29 -0600 Subject: [PATCH] mesa: added GL3 ContextFlags field and query code --- src/mesa/main/get.c | 12 ++++++++++++ src/mesa/main/get_gen.py | 3 ++- src/mesa/main/mtypes.h | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index edc44009120..b91f8db584f 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1932,6 +1932,9 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) case GL_MINOR_VERSION: params[0] = INT_TO_BOOLEAN(ctx->VersionMinor); break; + case GL_CONTEXT_FLAGS: + params[0] = INT_TO_BOOLEAN(ctx->Const.ContextFlags); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv(pname=0x%x)", pname); } @@ -3801,6 +3804,9 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) case GL_MINOR_VERSION: params[0] = (GLfloat)(ctx->VersionMinor); break; + case GL_CONTEXT_FLAGS: + params[0] = (GLfloat)(ctx->Const.ContextFlags); + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv(pname=0x%x)", pname); } @@ -5670,6 +5676,9 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) case GL_MINOR_VERSION: params[0] = ctx->VersionMinor; break; + case GL_CONTEXT_FLAGS: + params[0] = ctx->Const.ContextFlags; + break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv(pname=0x%x)", pname); } @@ -7540,6 +7549,9 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) case GL_MINOR_VERSION: params[0] = (GLint64)(ctx->VersionMinor); break; + case GL_CONTEXT_FLAGS: + params[0] = (GLint64)(ctx->Const.ContextFlags); + 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 9d5a51d58c5..3b0a5130f98 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -1062,7 +1062,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 ) + ( "GL_MINOR_VERSION", GLint, ["ctx->VersionMinor"], "", None ), + ( "GL_CONTEXT_FLAGS", GLint, ["ctx->Const.ContextFlags"], "", None ) ] diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 9d9b475dd17..82e004f3486 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2385,6 +2385,9 @@ struct gl_constants /**< GL_EXT_provoking_vertex */ GLboolean QuadsFollowProvokingVertexConvention; + + /**< OpenGL version 3.x */ + GLbitfield ContextFlags; /**< Ex: GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT */ }; -- 2.30.2