Commit c996c06b authored by Nigel Stewart's avatar Nigel Stewart
Browse files

[CoreSupport] For OpenGL 3.0 onwards use glGetStringi rather than glGetString(GL_EXTENSIONS)

parent 731b1e66
......@@ -117,7 +117,30 @@ GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
if (GLEW_VERSION_3_0)
{
/* TODO */
GLint n = 0;
GLint i;
PFNGLGETSTRINGIPROC getStringi;
const char *ext;
glGetIntegerv(GL_NUM_EXTENSIONS, &n);
/* glGetStringi is OpenGL 3.0 */
getStringi = (PFNGLGETSTRINGIPROC) glewGetProcAddress((const GLubyte*)"glGetStringi");
if (glGetStringi)
for (i = 0; i<n; ++i)
{
ext = (const char *) getStringi(GL_EXTENSIONS, i);
/* Based on extension string(s), glewGetExtension purposes */
enable = _glewGetExtensionString(ext);
if (enable)
*enable = GL_TRUE;
/* Based on extension string(s), experimental mode, glewIsSupported purposes */
enable = _glewGetExtensionEnable(ext);
if (enable)
*enable = GL_TRUE;
}
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment