mirror of
https://github.com/jenshemprich/MacGLide.git
synced 2024-09-27 10:55:07 +00:00
Improved backward compatibility by supporting non-arb extension GL_EXT_texture_rectangle
This commit is contained in:
parent
ab519288c5
commit
86182d2eed
@ -83,7 +83,7 @@ stExtensionSupport glNecessaryExt[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
// check to see if Extension is Supported
|
// check to see if Extension is Supported
|
||||||
// code by Mark J. Kilgard of NVidia modified by Fabio Barros
|
// code by Mark J. Kilgard of NVidia modified by Fabio Barros, improved by Jens-Olaf Hemprich
|
||||||
bool OGLIsExtensionSupported(const char* extensions, const char* extension)
|
bool OGLIsExtensionSupported(const char* extensions, const char* extension)
|
||||||
{
|
{
|
||||||
char* where = (char *) strchr( extension, ' ' );
|
char* where = (char *) strchr( extension, ' ' );
|
||||||
@ -115,31 +115,37 @@ bool OGLIsExtensionSupported(const char* extensions, const char* extension)
|
|||||||
}
|
}
|
||||||
start = terminator;
|
start = terminator;
|
||||||
}
|
}
|
||||||
|
// map ARB to EXT names in order to support older graphics cards
|
||||||
|
static const int numExtensions = 4;
|
||||||
|
static const struct
|
||||||
|
{
|
||||||
|
const char* arbName;
|
||||||
|
const char* extName;
|
||||||
|
}
|
||||||
|
extensionMapping[numExtensions] =
|
||||||
|
{
|
||||||
// fix for Rage 128 OpenGL Engine 1.1.ATI-5.99
|
// fix for Rage 128 OpenGL Engine 1.1.ATI-5.99
|
||||||
// (See apple techote TN2014)
|
// (See apple techote TN2014)
|
||||||
if (strcmp(extension, "GL_APPLE_packed_pixels") == 0)
|
{"GL_APPLE_packed_pixels","GL_APPLE_packed_pixel"},
|
||||||
{
|
|
||||||
return OGLIsExtensionSupported(extensions, "GL_APPLE_packed_pixel");
|
|
||||||
}
|
|
||||||
// fix for Rage 128 OpenGL Engine 1.1.ATI-5.99
|
// fix for Rage 128 OpenGL Engine 1.1.ATI-5.99
|
||||||
// support for GL_EXT_texture_env_combine
|
// support for GL_EXT_texture_env_combine
|
||||||
else if (strcmp(extension, "GL_ARB_texture_env_combine") == 0)
|
{"GL_ARB_texture_env_combine","GL_EXT_texture_env_combine"},
|
||||||
{
|
|
||||||
return OGLIsExtensionSupported(extensions, "GL_EXT_texture_env_combine");
|
|
||||||
}
|
|
||||||
// also support the older GL_EXT_texture_env_add
|
// also support the older GL_EXT_texture_env_add
|
||||||
else if (strcmp(extension, "GL_ARB_texture_env_add") == 0)
|
{"GL_ARB_texture_env_add","GL_EXT_texture_env_add"},
|
||||||
|
// and non-ARB texture rectangle extension GL_EXT_texture_rectangle
|
||||||
|
{"GL_ARB_texture_rectangle","GL_EXT_texture_rectangle"}
|
||||||
|
};
|
||||||
|
for(int i = 0; i < numExtensions; i++)
|
||||||
{
|
{
|
||||||
return OGLIsExtensionSupported(extensions, "GL_EXT_texture_env_add");
|
if (strcmp(extension, extensionMapping[i].arbName) == 0)
|
||||||
|
{
|
||||||
|
return OGLIsExtensionSupported(extensions, extensionMapping[i].extName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ValidateUserConfig( void )
|
void ValidateUserConfig(void)
|
||||||
{
|
{
|
||||||
glReportErrors("ValidateUserConfig");
|
glReportErrors("ValidateUserConfig");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user