diff options
author | Brian Paul <[email protected]> | 1999-08-19 13:57:42 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 1999-08-19 13:57:42 +0000 |
commit | a4dcdcf0ffae4c6cf52354fbd63c95d7d7815fd9 (patch) | |
tree | f4c57aa74226a59913cb650b87f7083eee5e34b6 /src/glut/glx/glut_glxext.c | |
parent | 2d550f6ff1afa3189874c99cfe4125362ee76797 (diff) |
initial check-in (post crash)
Diffstat (limited to 'src/glut/glx/glut_glxext.c')
-rw-r--r-- | src/glut/glx/glut_glxext.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/glut/glx/glut_glxext.c b/src/glut/glx/glut_glxext.c new file mode 100644 index 00000000000..04862432fc1 --- /dev/null +++ b/src/glut/glx/glut_glxext.c @@ -0,0 +1,48 @@ + +/* Copyright (c) Mark J. Kilgard, 1997. */ + +/* This program is freely distributable without licensing fees + and is provided without guarantee or warrantee expressed or + implied. This program is -not- in the public domain. */ + +#include <stdlib.h> +#include <string.h> +#include "glutint.h" + +#if defined(GLX_VERSION_1_1) +int +__glutIsSupportedByGLX(char *extension) +{ + static const char *extensions = NULL; + const char *start; + char *where, *terminator; + int major, minor; + + glXQueryVersion(__glutDisplay, &major, &minor); + /* Be careful not to call glXQueryExtensionsString if it + looks like the server doesn't support GLX 1.1. + Unfortunately, the original GLX 1.0 didn't have the notion + of GLX extensions. */ + if ((major == 1 && minor >= 1) || (major > 1)) { + if (!extensions) + extensions = glXQueryExtensionsString(__glutDisplay, __glutScreen); + /* It takes a bit of care to be fool-proof about parsing + the GLX extensions string. Don't be fooled by + sub-strings, etc. */ + start = extensions; + for (;;) { + where = strstr(start, extension); + if (!where) + return 0; + terminator = where + strlen(extension); + if (where == start || *(where - 1) == ' ') { + if (*terminator == ' ' || *terminator == '\0') { + return 1; + } + } + start = terminator; + } + } + return 0; +} +#endif |