summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoOGL
diff options
context:
space:
mode:
authorsl1nk3.s <sl1nk3.s@gmail.com>2009-12-30 15:08:18 +0000
committersl1nk3.s <sl1nk3.s@gmail.com>2009-12-30 15:08:18 +0000
commit18e951f97ac7e0fb7cbd3dad775577eee3a33396 (patch)
treef6915877daf5f2ed6d136ec1fa5f16a012c23f2a /Source/Plugins/Plugin_VideoOGL
parent151ff28ab7dd1fd0343587f194bf8620d5fc3620 (diff)
Fix a crash when closing DirectX's window, also apply a fix from j4ck.fr0st/BhaaL @ issue 1277 to prevent two possibles hang on stop.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4756 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp18
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/main.cpp5
2 files changed, 12 insertions, 11 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp
index ff9c5e3840..303abdcbbf 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp
@@ -342,7 +342,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
OnKeyDown(lParam);
FreeLookInput(wParam, lParam);
}
- if (wParam == TOGGLE_FULLSCREEN)
+ if (wParam == TOGGLE_FULLSCREEN && !g_Config.RenderToMainframe)
ToggleFullscreen(m_hWnd);
break;
@@ -479,7 +479,7 @@ void ToggleFullscreen(HWND hParent)
SetWindowPos(hParent, NULL, X, Y, w_fs, h_fs, SWP_NOREPOSITION | SWP_NOZORDER);
// Set new window style FS -> Windowed
- SetWindowLong(hParent, GWL_STYLE, WS_OVERLAPPEDWINDOW);
+ SetWindowLongPtr(hParent, GWL_STYLE, WS_OVERLAPPEDWINDOW);
// Eventually show the window!
EmuWindow::Show();
@@ -497,18 +497,18 @@ void ToggleFullscreen(HWND hParent)
dmScreenSettings.dmSize = sizeof(dmScreenSettings);
dmScreenSettings.dmPelsWidth = w_fs;
dmScreenSettings.dmPelsHeight = h_fs;
- dmScreenSettings.dmBitsPerPel = 32;
- dmScreenSettings.dmFields = DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
- if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
+ dmScreenSettings.dmFields = DM_PELSWIDTH|DM_PELSHEIGHT;
+ if (ChangeDisplaySettings(&dmScreenSettings, 0) != DISP_CHANGE_SUCCESSFUL)
return;
// Set new window style -> PopUp
- SetWindowLong(hParent, GWL_STYLE, WS_POPUP);
- g_Config.bFullscreen = true;
- ShowCursor(FALSE);
+ SetWindowLongPtr(hParent, GWL_STYLE, WS_POPUP);
// SetWindowPos to the upper-left corner of the screen
- SetWindowPos(hParent, NULL, 0, 0, w_fs, h_fs, SWP_NOREPOSITION | SWP_NOZORDER);
+ SetWindowPos(hParent, HWND_TOP, 0, 0, w_fs, h_fs, SWP_NOREPOSITION);
+
+ g_Config.bFullscreen = true;
+ ShowCursor(FALSE);
// Eventually show the window!
EmuWindow::Show();
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp
index 393ed3d438..2db8ea7d7e 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/main.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/main.cpp
@@ -410,6 +410,7 @@ void Video_Prepare(void)
void Shutdown(void)
{
s_PluginInitialized = false;
+ ForceSwap = true;
s_efbAccessRequested = FALSE;
s_swapRequested = FALSE;
@@ -516,7 +517,7 @@ void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
// Make sure previous swap request has made it to the screen
if (g_VideoInitialize.bOnThread)
{
- while (Common::AtomicLoadAcquire(s_swapRequested))
+ while (Common::AtomicLoadAcquire(s_swapRequested) && s_PluginInitialized)
Common::YieldCPU();
}
else
@@ -569,7 +570,7 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y)
if (g_VideoInitialize.bOnThread)
{
- while (Common::AtomicLoadAcquire(s_efbAccessRequested))
+ while (Common::AtomicLoadAcquire(s_efbAccessRequested) && s_PluginInitialized)
Common::YieldCPU();
}
else