Get GL extension strings via glGetStringi() if GL version is >= 3.0.

This commit is contained in:
Matthias Bentrup 2015-02-04 15:44:01 +01:00 committed by Nigel Stewart
parent e935fcad83
commit bac20de049

View File

@ -1,5 +1,29 @@
/* query opengl extensions string */ /* query opengl extensions string(s) */
if(GLEW_VERSION_3_0)
{
GLuint len;
struct initflag *ptr;
glGetIntegerv(GL_NUM_EXTENSIONS, &numExts);
for (ext = 0; ext < numExts; ext++)
{
extStart = glGetStringi(GL_EXTENSIONS, ext);
len = _glewStrLen(extStart);
ptr = in_word_set(extStart, len);
if (ptr != NULL && ptr->flag != NULL) {
#ifdef GLEW_MX
*(GLboolean *)((char *)ctx + (size_t)(ptr->flag)) = GL_TRUE;
#else
*ptr->flag = GL_TRUE;
#endif
}
extStart += len + 1;
}
}
else
{
extStart = glGetString(GL_EXTENSIONS); extStart = glGetString(GL_EXTENSIONS);
if (extStart == 0) if (extStart == 0)
extStart = (const GLubyte*)""; extStart = (const GLubyte*)"";
@ -19,5 +43,6 @@
} }
extStart += len + 1; extStart += len + 1;
} }
}
/* initialize extensions */ /* initialize extensions */