summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>1999-11-12 02:05:46 +0000
committerBrian Paul <[email protected]>1999-11-12 02:05:46 +0000
commita087e348ab534a8293c0dc1eb7fda8794326259d (patch)
tree6a458d2d2fe8356ddb3e6280b55a8c73f6cf1c8e
parentea895e68394f6a9970b226b589fb722acd3f090b (diff)
added gl_extension_is_enabled()
-rw-r--r--src/mesa/main/extensions.c20
-rw-r--r--src/mesa/main/extensions.h3
2 files changed, 21 insertions, 2 deletions
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 683fba79a0f..c8b154d0613 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -1,4 +1,4 @@
-/* $Id: extensions.c,v 1.11 1999/11/11 01:22:26 brianp Exp $ */
+/* $Id: extensions.c,v 1.12 1999/11/12 02:05:46 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -133,6 +133,24 @@ int gl_extensions_disable( GLcontext *ctx, const char *name )
}
+/*
+ * Test if the named extension is enabled in this context.
+ */
+GLboolean gl_extension_is_enabled( GLcontext *ctx, const char *name)
+{
+ struct extension *i;
+ foreach( i, ctx->Extensions.ext_list )
+ if (strncmp(i->name, name, MAX_EXT_NAMELEN) == 0) {
+ if (i->enabled)
+ return GL_TRUE;
+ else
+ return GL_FALSE;
+ }
+
+ return GL_FALSE;
+}
+
+
void gl_extensions_dtr( GLcontext *ctx )
{
struct extension *i, *nexti;
diff --git a/src/mesa/main/extensions.h b/src/mesa/main/extensions.h
index c5316192f8d..1ff8e2702aa 100644
--- a/src/mesa/main/extensions.h
+++ b/src/mesa/main/extensions.h
@@ -1,4 +1,4 @@
-/* $Id: extensions.h,v 1.5 1999/10/16 11:30:27 brianp Exp $ */
+/* $Id: extensions.h,v 1.6 1999/11/12 02:05:46 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -42,6 +42,7 @@ extern int gl_extensions_add( struct gl_context *ctx, int state,
extern int gl_extensions_enable( struct gl_context *ctx, const char *name );
extern int gl_extensions_disable( struct gl_context *ctx, const char *name );
+extern GLboolean gl_extension_is_enabled( GLcontext *ctx, const char *name);
extern void gl_extensions_dtr( struct gl_context *ctx );
extern void gl_extensions_ctr( struct gl_context *ctx );
extern const char *gl_extensions_get_string( struct gl_context *ctx );