Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 05/10/2010 Modified by BenXYZ from the GLEW project, see copyright: http://glew.sourceforge.net/credits.html
- GLboolean glewGetExtension (const char* name)
- {
- GLubyte* p;
- GLubyte* end;
- GLuint len = _glewStrLen((const GLubyte*)name);
- p = (GLubyte*)glGetString(GL_EXTENSIONS);
- //if glGetString() failed, attempt glGetStringi()
- if (0 == p)
- {
- GLint numextns; glGetIntegerv(GL_NUM_EXTENSIONS, &numextns);
- GLuint iii;
- for (iii = 0; iii < numextns; iii++)
- {
- p = glGetStringi(GL_EXTENSIONS, iii);
- if (_glewStrSame((const GLubyte*)name, p, _glewStrLen(p))) return GL_TRUE;
- }
- return GL_FALSE;
- }
- //...or if glGetString() worked, carry on as usual
- end = p + _glewStrLen(p);
- while (p < end)
- {
- GLuint n = _glewStrCLen(p, ' ');
- if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
- p += n+1;
- }
- return GL_FALSE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement