mirror of
https://github.com/nigels-com/glew.git
synced 2025-01-31 08:50:26 +00:00
Fix glewGetExtension on core context
This commit is contained in:
parent
c8fea198b3
commit
f1aac50e30
@ -5,8 +5,22 @@ GLboolean GLEWAPIENTRY glewGetExtension (const char* name)
|
||||
const GLubyte* start;
|
||||
const GLubyte* end;
|
||||
start = (const GLubyte*)glGetString(GL_EXTENSIONS);
|
||||
if (start == 0)
|
||||
if (start == 0) {
|
||||
/* no extension string, we're probably on a core context
|
||||
query extensions one at a time */
|
||||
GLint numExtensions = 0;
|
||||
int i;
|
||||
glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
|
||||
/* glewContextInit should have initialized glGetStringi for us */
|
||||
for (i = 0; i < numExtensions; i++) {
|
||||
const GLubyte* extName = glGetStringi(GL_EXTENSIONS, i);
|
||||
GLuint len = _glewStrLen(extName);
|
||||
if (_glewStrSame((const GLubyte*) name, extName, len)) {
|
||||
return GL_TRUE;
|
||||
}
|
||||
}
|
||||
return GL_FALSE;
|
||||
}
|
||||
end = start + _glewStrLen(start);
|
||||
return _glewSearchExtension(name, start, end);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user