From 802b80893943cf129039a37fb2afe26444b09332 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Dec 2009 10:16:01 -0700 Subject: mesa: implement GL3 GL_NUM_EXTENSIONS query --- src/mesa/main/extensions.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa/main/extensions.h') diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h index 05ad859a27..194c2efa40 100644 --- a/src/mesa/main/extensions.h +++ b/src/mesa/main/extensions.h @@ -64,6 +64,10 @@ extern void _mesa_init_extensions(GLcontext *ctx); extern GLubyte *_mesa_make_extension_string(GLcontext *ctx); +extern GLuint +_mesa_get_extension_count(GLcontext *ctx); + + #else /** No-op */ -- cgit v1.2.3 From 56bdaca03e2289f56d1c88668d0a0f1dbd5abeca Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Dec 2009 10:29:53 -0700 Subject: mesa: _mesa_get_enabled_extension() function --- src/mesa/main/extensions.c | 20 ++++++++++++++++++++ src/mesa/main/extensions.h | 3 +++ 2 files changed, 23 insertions(+) (limited to 'src/mesa/main/extensions.h') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 88c025ee32..7aec95f048 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 194c2efa40..a25472440d 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 -- cgit v1.2.3