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_SYSKEYDOWN:
|
||||
#ifndef FUCKDXGI
|
||||
#if 0
|
||||
if (keydown[K_LALT] && wParam == '\r')
|
||||
{
|
||||
if (d3dscreen)
|
||||
|
@ -564,19 +564,22 @@ static LRESULT WINAPI D3D11_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
|
|||
}
|
||||
return 0;
|
||||
case WM_SIZE:
|
||||
d3d_resized = true;
|
||||
if (d3dswapchain)
|
||||
{
|
||||
d3d_resized = true;
|
||||
|
||||
D3DVID_UpdateWindowStatus(mainwindow);
|
||||
D3DVID_UpdateWindowStatus(mainwindow);
|
||||
|
||||
released3dbackbuffer();
|
||||
IDXGISwapChain_ResizeBuffers(d3dswapchain, 0, 0, 0, DXGI_FORMAT_UNKNOWN, DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH);
|
||||
released3dbackbuffer();
|
||||
IDXGISwapChain_ResizeBuffers(d3dswapchain, 0, 0, 0, DXGI_FORMAT_UNKNOWN, DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH);
|
||||
|
||||
D3D11BE_Reset(true);
|
||||
vid.pixelwidth = window_rect.right - window_rect.left;
|
||||
vid.pixelheight = window_rect.bottom - window_rect.top;
|
||||
resetd3dbackbuffer(vid.pixelwidth, vid.pixelheight);
|
||||
D3D11BE_Reset(false);
|
||||
lRet = DefWindowProc (hWnd, uMsg, wParam, lParam);
|
||||
D3D11BE_Reset(true);
|
||||
vid.pixelwidth = window_rect.right - window_rect.left;
|
||||
vid.pixelheight = window_rect.bottom - window_rect.top;
|
||||
resetd3dbackbuffer(vid.pixelwidth, vid.pixelheight);
|
||||
D3D11BE_Reset(false);
|
||||
}
|
||||
lRet = DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||
break;
|
||||
|
||||
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.
|
||||
//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);
|
||||
}
|
||||
}
|
||||
|
@ -1058,7 +1061,7 @@ static qboolean D3D11_VID_Init(rendererstate_t *info, unsigned char *palette)
|
|||
|
||||
RegisterClass(&wc);
|
||||
|
||||
if (info->fullscreen/* == 2*/)
|
||||
if (info->fullscreen == 2)
|
||||
modestate = MS_FULLWINDOW;
|
||||
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.
|
||||
|
@ -1099,13 +1102,6 @@ static qboolean D3D11_VID_Init(rendererstate_t *info, unsigned char *palette)
|
|||
vid.pixelwidth = width;
|
||||
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))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
|
@ -1122,6 +1118,13 @@ static qboolean D3D11_VID_Init(rendererstate_t *info, unsigned char *palette)
|
|||
vid.width = vid.pixelwidth;
|
||||
vid.height = vid.pixelheight;
|
||||
|
||||
if (modestate == MS_FULLSCREEN)
|
||||
{
|
||||
if (!d3dscreen)
|
||||
IDXGISwapChain_GetContainingOutput(d3dswapchain, &d3dscreen);
|
||||
IDXGISwapChain_SetFullscreenState(d3dswapchain, true, d3dscreen);
|
||||
}
|
||||
|
||||
vid_initializing = false;
|
||||
|
||||
GetWindowRect(mainwindow, &window_rect);
|
||||
|
|
Loading…
Reference in a new issue