summaryrefslogtreecommitdiff
path: root/src/glu/mesa/glu.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>1999-09-14 00:11:40 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>1999-09-14 00:11:40 +0000
commita96e8ad9788c5c4aa2ff62b87d9e3f86be21513d (patch)
tree001c05fd2b0a223b01d5b4d0a5261c3d7b41c576 /src/glu/mesa/glu.c
parentdaa0b0f65671f48dacd892034a24fc6549d9908e (diff)
added gluCheckExtension()
Diffstat (limited to 'src/glu/mesa/glu.c')
-rw-r--r--src/glu/mesa/glu.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/glu/mesa/glu.c b/src/glu/mesa/glu.c
index be73335ad7..53ad0ff26f 100644
--- a/src/glu/mesa/glu.c
+++ b/src/glu/mesa/glu.c
@@ -1,4 +1,4 @@
-/* $Id: glu.c,v 1.6 1999/09/13 14:31:32 joukj Exp $ */
+/* $Id: glu.c,v 1.7 1999/09/14 00:11:40 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,6 +23,9 @@
/*
* $Log: glu.c,v $
+ * Revision 1.7 1999/09/14 00:11:40 brianp
+ * added gluCheckExtension()
+ *
* Revision 1.6 1999/09/13 14:31:32 joukj
*
* strcmp needs the string.h
@@ -87,6 +90,7 @@
#ifdef PC_HEADER
#include "all.h"
#else
+#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
@@ -388,3 +392,29 @@ GLfunction GLAPIENTRY gluGetProcAddressEXT( const GLubyte *procName )
#endif
+
+
+/*
+ * New in GLU 1.3
+ */
+GLboolean GLAPIENTRY
+gluCheckExtension( const char *extName, const GLubyte *extString )
+{
+ assert(extName);
+ assert(extString);
+ {
+ const int len = strlen(extName);
+ const char *start = (const char *) extString;
+
+ while (1) {
+ const char *c = strstr( start, extName );
+ if (!c)
+ return GL_FALSE;
+
+ if ((c == start || c[-1] == ' ') && (c[len] == ' ' || c[len] == 0))
+ return GL_TRUE;
+
+ start = c + len;
+ }
+ }
+}