opengl32: Make it possible to use an alternative in wglGetProcAddress when an extension is missing.

This commit is contained in:
Alexandre Julliard 2015-12-09 15:44:51 +09:00
parent 571dc0faa5
commit 5c9ddc55dc
1 changed files with 13 additions and 0 deletions

View File

@ -878,6 +878,19 @@ PROC WINAPI wglGetProcAddress( LPCSTR name )
if (!is_extension_supported(ext_ret->extension))
{
unsigned int i;
static const struct { const char *name, *alt; } alternatives[] =
{
{ "glCopyTexSubImage3DEXT", "glCopyTexSubImage3D" }, /* needed by RuneScape */
};
for (i = 0; i < sizeof(alternatives)/sizeof(alternatives[0]); i++)
{
if (strcmp( name, alternatives[i].name )) continue;
WARN("Extension %s required for %s not supported, trying %s\n",
ext_ret->extension, name, alternatives[i].alt );
return wglGetProcAddress( alternatives[i].alt );
}
WARN("Extension %s required for %s not supported\n", ext_ret->extension, name);
return NULL;
}