summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-03-20 11:50:29 -0600
committerBrian Paul <[email protected]>2010-03-20 12:06:35 -0600
commit00225af999acabcd5eced0b075b0a56018fd5eb8 (patch)
treef8fd25112c8f01bf614700d3221b57147aa5df81
parent05c03c6a1bcfb8ad77d3025f166f02ddaa741aa2 (diff)
mesa: added GL3 ContextFlags field and query code
-rw-r--r--src/mesa/main/get.c12
-rw-r--r--src/mesa/main/get_gen.py3
-rw-r--r--src/mesa/main/mtypes.h3
3 files changed, 17 insertions, 1 deletions
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 */
};