gsdx: throw an exception when we miss a mandatory gl feature

Gracefully quits when driver is not supported
(like nvidia legacy driver for GTX260)

Please test the impact on windows
This commit is contained in:
Gregory Hainaut 2015-05-26 10:52:00 +02:00
parent 3be5a6036b
commit a3bbe68d56
2 changed files with 15 additions and 4 deletions

View File

@ -400,14 +400,23 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
}
}
}
#endif
#ifdef _WINDOWS
try
{
s_gs->m_wnd->Attach(*dsp, false);
}
catch (GSDXRecoverableError)
{
s_gs->m_wnd->Detach();
delete s_gs->m_wnd;
s_gs->m_wnd = NULL;
}
#endif
if (s_gs->m_wnd == NULL)
{
return -1;
}
#endif
#ifdef _WINDOWS
s_gs->m_wnd->Attach(*dsp, false);
#endif
}
if(!s_gs->CreateDevice(dev))

View File

@ -275,6 +275,8 @@ void* GSWndWGL::GetProcAddress(const char* name, bool opt)
void* ptr = (void*)wglGetProcAddress(name);
if (ptr == NULL) {
fprintf(stderr, "Failed to find %s\n", name);
if (!opt)
throw GSDXRecoverableError();
}
return ptr;
}