Patch from GoaLitiuM to fix some d3d11 stability/alt-tabbing issues.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5330 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
9a146f448f
commit
eb56cc76df
1 changed files with 23 additions and 20 deletions
|
@ -373,7 +373,7 @@ static LRESULT WINAPI D3D11_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
|
||||||
|
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
case WM_SYSKEYDOWN:
|
case WM_SYSKEYDOWN:
|
||||||
#ifndef FUCKDXGI
|
#if 0
|
||||||
if (keydown[K_LALT] && wParam == '\r')
|
if (keydown[K_LALT] && wParam == '\r')
|
||||||
{
|
{
|
||||||
if (d3dscreen)
|
if (d3dscreen)
|
||||||
|
@ -564,6 +564,8 @@ static LRESULT WINAPI D3D11_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
|
if (d3dswapchain)
|
||||||
|
{
|
||||||
d3d_resized = true;
|
d3d_resized = true;
|
||||||
|
|
||||||
D3DVID_UpdateWindowStatus(mainwindow);
|
D3DVID_UpdateWindowStatus(mainwindow);
|
||||||
|
@ -576,7 +578,8 @@ static LRESULT WINAPI D3D11_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
|
||||||
vid.pixelheight = window_rect.bottom - window_rect.top;
|
vid.pixelheight = window_rect.bottom - window_rect.top;
|
||||||
resetd3dbackbuffer(vid.pixelwidth, vid.pixelheight);
|
resetd3dbackbuffer(vid.pixelwidth, vid.pixelheight);
|
||||||
D3D11BE_Reset(false);
|
D3D11BE_Reset(false);
|
||||||
lRet = DefWindowProc (hWnd, uMsg, wParam, lParam);
|
}
|
||||||
|
lRet = DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
|
@ -1016,7 +1019,7 @@ static void initD3D11(HWND hWnd, rendererstate_t *info)
|
||||||
{
|
{
|
||||||
//DXGI SUCKS and fucks up alt+tab every single time. its pointless to go from fullscreen to fullscreen-with-taskbar-obscuring-half-the-window.
|
//DXGI SUCKS and fucks up alt+tab every single time. its pointless to go from fullscreen to fullscreen-with-taskbar-obscuring-half-the-window.
|
||||||
//I'm just going to handle that stuff myself.
|
//I'm just going to handle that stuff myself.
|
||||||
IDXGIFactory1_MakeWindowAssociation(fact, hWnd, DXGI_MWA_NO_WINDOW_CHANGES|DXGI_MWA_NO_ALT_ENTER|DXGI_MWA_NO_PRINT_SCREEN);
|
//IDXGIFactory1_MakeWindowAssociation(fact, hWnd, DXGI_MWA_NO_WINDOW_CHANGES|DXGI_MWA_NO_ALT_ENTER|DXGI_MWA_NO_PRINT_SCREEN);
|
||||||
IDXGIFactory1_Release(fact);
|
IDXGIFactory1_Release(fact);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1058,7 +1061,7 @@ static qboolean D3D11_VID_Init(rendererstate_t *info, unsigned char *palette)
|
||||||
|
|
||||||
RegisterClass(&wc);
|
RegisterClass(&wc);
|
||||||
|
|
||||||
if (info->fullscreen/* == 2*/)
|
if (info->fullscreen == 2)
|
||||||
modestate = MS_FULLWINDOW;
|
modestate = MS_FULLWINDOW;
|
||||||
else if (info->fullscreen)
|
else if (info->fullscreen)
|
||||||
modestate = MS_FULLSCREEN; //FIXME: I'm done with fighting dxgi. I'm just going to pick the easy method that doesn't end up with totally fucked up behaviour.
|
modestate = MS_FULLSCREEN; //FIXME: I'm done with fighting dxgi. I'm just going to pick the easy method that doesn't end up with totally fucked up behaviour.
|
||||||
|
@ -1099,13 +1102,6 @@ static qboolean D3D11_VID_Init(rendererstate_t *info, unsigned char *palette)
|
||||||
vid.pixelwidth = width;
|
vid.pixelwidth = width;
|
||||||
vid.pixelheight = height;
|
vid.pixelheight = height;
|
||||||
|
|
||||||
if (modestate == MS_FULLSCREEN)
|
|
||||||
{
|
|
||||||
if (!d3dscreen)
|
|
||||||
IDXGISwapChain_GetContainingOutput(d3dswapchain, &d3dscreen);
|
|
||||||
IDXGISwapChain_SetFullscreenState(d3dswapchain, true, d3dscreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||||
{
|
{
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
|
@ -1122,6 +1118,13 @@ static qboolean D3D11_VID_Init(rendererstate_t *info, unsigned char *palette)
|
||||||
vid.width = vid.pixelwidth;
|
vid.width = vid.pixelwidth;
|
||||||
vid.height = vid.pixelheight;
|
vid.height = vid.pixelheight;
|
||||||
|
|
||||||
|
if (modestate == MS_FULLSCREEN)
|
||||||
|
{
|
||||||
|
if (!d3dscreen)
|
||||||
|
IDXGISwapChain_GetContainingOutput(d3dswapchain, &d3dscreen);
|
||||||
|
IDXGISwapChain_SetFullscreenState(d3dswapchain, true, d3dscreen);
|
||||||
|
}
|
||||||
|
|
||||||
vid_initializing = false;
|
vid_initializing = false;
|
||||||
|
|
||||||
GetWindowRect(mainwindow, &window_rect);
|
GetWindowRect(mainwindow, &window_rect);
|
||||||
|
|
Loading…
Reference in a new issue