forked from cafeberry/cafeberry
feat(Windows64): use screen size instead of window size, fix exit game, fix oprhaned saves on exit without saving
This commit is contained in:
@@ -406,7 +406,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow(g_hWnd, nCmdShow);
|
||||
ShowWindow(g_hWnd, (nCmdShow != SW_HIDE) ? SW_SHOWMAXIMIZED : nCmdShow);
|
||||
UpdateWindow(g_hWnd);
|
||||
|
||||
return TRUE;
|
||||
@@ -467,10 +467,9 @@ HRESULT InitDevice()
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
RECT rc;
|
||||
GetClientRect( g_hWnd, &rc );
|
||||
g_iScreenWidth = rc.right - rc.left;
|
||||
g_iScreenHeight = rc.bottom - rc.top;
|
||||
//str1k3r - use screen size instead of window size
|
||||
g_iScreenWidth = GetSystemMetrics(SM_CXSCREEN);
|
||||
g_iScreenHeight = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
//str1k3r - stop hardcoding size and just use the screens actual size
|
||||
UINT width = g_iScreenWidth;
|
||||
@@ -546,6 +545,7 @@ HRESULT InitDevice()
|
||||
hr = g_pd3dDevice->CreateTexture2D(&descDepth, NULL, &g_pDepthStencilBuffer);
|
||||
|
||||
D3D11_DEPTH_STENCIL_VIEW_DESC descDSView;
|
||||
ZeroMemory(&descDSView, sizeof(descDSView));
|
||||
descDSView.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
|
||||
descDSView.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
|
||||
descDSView.Texture2D.MipSlice = 0;
|
||||
|
||||
Reference in New Issue
Block a user