Doxygen Source Code Documentation
glut_ext.c File Reference
#include <string.h>
#include <GL/glut.h>
#include "glutint.h"
Go to the source code of this file.
Functions | |
int | glutExtensionSupported (char *extension) |
int | __glutIsSupportedByGLX (char *extension) |
Function Documentation
|
Definition at line 47 of file glut_ext.c. Referenced by checkOverlayAcceptability(), getVisualInfoRGB(), and glutGet().
00048 { 00049 #if defined(GLX_VERSION_1_1) 00050 static const char *extensions = NULL; 00051 const char *start; 00052 char *where, *terminator; 00053 int major, minor; 00054 00055 glXQueryVersion(__glutDisplay, &major, &minor); 00056 /* Be careful not to call glXQueryExtensionsString if it 00057 looks like the server doesn't support GLX 1.1. 00058 Unfortunately, the original GLX 1.0 didn't have the notion 00059 of GLX extensions. */ 00060 if ((major == 1 && minor >= 1) || (major > 1)) { 00061 if (!extensions) 00062 extensions = glXQueryExtensionsString(__glutDisplay, __glutScreen); 00063 /* It takes a bit of care to be fool-proof about parsing 00064 the GLX extensions string. Don't be fooled by 00065 sub-strings, etc. */ 00066 start = extensions; 00067 for (;;) { 00068 where = strstr(start, extension); 00069 if (!where) 00070 return 0; 00071 terminator = where + strlen(extension); 00072 if (where == start || *(where - 1) == ' ') { 00073 if (*terminator == ' ' || *terminator == '\0') { 00074 return 1; 00075 } 00076 } 00077 start = terminator; 00078 } 00079 } 00080 #else 00081 /* No GLX extensions before GLX 1.1 */ 00082 #endif 00083 return 0; 00084 } |
|
Definition at line 14 of file glut_ext.c.
00015 { 00016 static const GLubyte *extensions = NULL; 00017 const GLubyte *start; 00018 GLubyte *where, *terminator; 00019 00020 /* Extension names should not have spaces. */ 00021 where = (GLubyte *) strchr(extension, ' '); 00022 if (where || *extension == '\0') 00023 return 0; 00024 00025 if (!extensions) 00026 extensions = glGetString(GL_EXTENSIONS); 00027 /* It takes a bit of care to be fool-proof about parsing the 00028 OpenGL extensions string. Don't be fooled by sub-strings, 00029 etc. */ 00030 start = extensions; 00031 for (;;) { 00032 where = (GLubyte *) strstr((const char *)start, extension); 00033 if (!where) 00034 break; 00035 terminator = where + strlen(extension); 00036 if (where == start || *(where - 1) == ' ') { 00037 if (*terminator == ' ' || *terminator == '\0') { 00038 return 1; 00039 } 00040 } 00041 start = terminator; 00042 } 00043 return 0; 00044 } |