summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/extensions.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-12-30 10:16:01 -0700
committerBrian Paul <[email protected]>2009-12-30 10:16:01 -0700
commit802b80893943cf129039a37fb2afe26444b09332 (patch)
tree309accdb5aecc2da7b5a824ef288a981152aa866 /src/mesa/main/extensions.c
parent1ec6de9f948b45e24ecd0e039819e90863ec9646 (diff)
mesa: implement GL3 GL_NUM_EXTENSIONS query
Diffstat (limited to 'src/mesa/main/extensions.c')
-rw-r--r--src/mesa/main/extensions.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index a1561b4065b..88c025ee326 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -700,3 +700,28 @@ _mesa_make_extension_string( GLcontext *ctx )
return (GLubyte *) s;
}
+
+
+/**
+ * Return number of enabled extensions.
+ */
+GLuint
+_mesa_get_extension_count(GLcontext *ctx)
+{
+ GLuint i;
+
+ /* only count once */
+ if (!ctx->Extensions.Count) {
+ for (i = 0; i < Elements(default_extensions); i++) {
+ if (extension_enabled(ctx, i)) {
+ ctx->Extensions.Count++;
+ }
+ }
+ }
+
+ if (0)
+ _mesa_debug(ctx, "%u of %d extensions enabled\n", ctx->Extensions.Count,
+ Elements(default_extensions));
+
+ return ctx->Extensions.Count;
+}