OpenGL: Added option to build without WxWidgets in Windows to, if it has anything to do with the FreeLibrary() hanging. It doesn't seem to do, but now it's easier to compile without it at least.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2358 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-02-22 05:21:54 +00:00
parent db691a4f0d
commit 2a94635523
7 changed files with 54 additions and 29 deletions

View File

@ -46,17 +46,21 @@ void CloseConsole();
HINSTANCE g_hInstance;
class wxDLLApp : public wxApp
{
bool OnInit()
// ------------------------------------------------------
// WxWidgets
// ---------------
#if defined(HAVE_WX) && HAVE_WX
class wxDLLApp : public wxApp
{
return true;
}
};
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
bool OnInit()
{
return true;
}
};
IMPLEMENT_APP_NO_MAIN(wxDLLApp)
WXDLLIMPEXP_BASE void wxSetInstance(HINSTANCE hInst);
#endif
// ------------------
BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
DWORD dwReason, // reason called
@ -65,19 +69,32 @@ BOOL APIENTRY DllMain(HINSTANCE hinstDLL, // DLL module handle
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
{ // Use wxInitialize() if you don't want GUI instead of the following 12 lines
{
#if defined(HAVE_WX) && HAVE_WX
// Use wxInitialize() if you don't want GUI instead of the following 12 lines
wxSetInstance((HINSTANCE)hinstDLL);
int argc = 0;
char **argv = NULL;
wxEntryStart(argc, argv);
if (!wxTheApp || !wxTheApp->CallOnInit())
return FALSE;
#endif
}
break;
case DLL_PROCESS_DETACH:
// This causes a "stop hang", if the gfx config dialog has been opened.
wxEntryCleanup(); // Use wxUninitialize() if you don't want GUI
#if defined(HAVE_WX) && HAVE_WX
// This causes a "stop hang", if the gfx config dialog has been opened.
/* JP: Are you sure? Because I tried to debug that for hours with countless Stop and Start
and I frequently gor the stop hang even if I did not open the wxDialog
Update: Howwver, compiling with 'HAVE_WX 0' seems to have reduced the number of hangins,
it only hanged once with that option. And that was when I stopped Starfox Assault that
by the way doesn't work now (it has a black screen).
Update again: No it was probably related to something else, now I had the same luck
with WxWidgets in it to. */
// Old comment: "Use wxUninitialize() if you don't want GUI"
wxEntryCleanup();
#endif
break;
default:
break;