mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- fixed: If we want to support pre-GL3 hardware, we may not require the presence of glGetStringi.
This commit is contained in:
parent
2b710ec73d
commit
50ab301bd8
1 changed files with 28 additions and 3 deletions
|
@ -66,11 +66,36 @@ 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)
|
||||||
|
{
|
||||||
|
// Try old method to collect extensions
|
||||||
|
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);
|
extension = (const char*)glGetStringi(GL_EXTENSIONS, i);
|
||||||
m_Extensions.Push(FString(extension));
|
m_Extensions.Push(FString(extension));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
Loading…
Reference in a new issue