Mesa (master): mesa: _mesa_get_enabled_extension() function

Brian Paul brianp at kemper.freedesktop.org
Wed Dec 30 09:33:17 PST 2009


Module: Mesa
Branch: master
Commit: 56bdaca03e2289f56d1c88668d0a0f1dbd5abeca
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=56bdaca03e2289f56d1c88668d0a0f1dbd5abeca

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Dec 30 10:29:53 2009 -0700

mesa: _mesa_get_enabled_extension() function

---

 src/mesa/main/extensions.c |   20 ++++++++++++++++++++
 src/mesa/main/extensions.h |    3 +++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 88c025e..7aec95f 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -725,3 +725,23 @@ _mesa_get_extension_count(GLcontext *ctx)
 
    return ctx->Extensions.Count;
 }
+
+
+/**
+ * Return name of i-th enabled extension
+ */
+const GLubyte *
+_mesa_get_enabled_extension(GLcontext *ctx, GLuint index)
+{
+   GLuint i;
+
+   for (i = 0; i < Elements(default_extensions); i++) {
+      if (extension_enabled(ctx, i)) {
+         if (index == 0)
+            return (const GLubyte *) default_extensions[i].name;
+         index--;
+      }
+   }
+
+   return NULL;
+}
diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h
index 194c2ef..a254724 100644
--- a/src/mesa/main/extensions.h
+++ b/src/mesa/main/extensions.h
@@ -67,6 +67,9 @@ extern GLubyte *_mesa_make_extension_string(GLcontext *ctx);
 extern GLuint
 _mesa_get_extension_count(GLcontext *ctx);
 
+extern const GLubyte *
+_mesa_get_enabled_extension(GLcontext *ctx, GLuint index);
+
 
 #else
 



More information about the mesa-commit mailing list