This commit is contained in:
nashmuhandes 2016-04-30 22:32:43 +08:00
commit 6f65875cfa

View file

@ -66,10 +66,35 @@ static void CollectExtensions()
int max = 0; int max = 0;
glGetIntegerv(GL_NUM_EXTENSIONS, &max); glGetIntegerv(GL_NUM_EXTENSIONS, &max);
for(int i = 0; i < max; i++) if (0 == max)
{ {
extension = (const char*)glGetStringi(GL_EXTENSIONS, i); // Try old method to collect extensions
m_Extensions.Push(FString(extension)); const char *supported = (char *)glGetString(GL_EXTENSIONS);
if (nullptr != supported)
{
char *extensions = new char[strlen(supported) + 1];
strcpy(extensions, supported);
char *extension = strtok(extensions, " ");
while (extension)
{
m_Extensions.Push(FString(extension));
extension = strtok(nullptr, " ");
}
delete [] extensions;
}
}
else
{
// Use modern method to collect extensions
for (int i = 0; i < max; i++)
{
extension = (const char*)glGetStringi(GL_EXTENSIONS, i);
m_Extensions.Push(FString(extension));
}
} }
} }