Resize framebuffer in windowed mode to match the client area

This commit is contained in:
Magnus Norddahl 2016-09-12 13:04:36 +02:00
commit d3d8180f57
4 changed files with 70 additions and 10 deletions

View file

@ -537,10 +537,18 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if (screen && !VidResizing)
{
LPMINMAXINFO mmi = (LPMINMAXINFO)lParam;
RECT rect = { 0, 0, screen->GetWidth(), screen->GetHeight() };
AdjustWindowRectEx(&rect, WS_VISIBLE|WS_OVERLAPPEDWINDOW, FALSE, WS_EX_APPWINDOW);
mmi->ptMinTrackSize.x = rect.right - rect.left;
mmi->ptMinTrackSize.y = rect.bottom - rect.top;
if (screen->IsFullscreen())
{
RECT rect = { 0, 0, screen->GetWidth(), screen->GetHeight() };
AdjustWindowRectEx(&rect, WS_VISIBLE | WS_OVERLAPPEDWINDOW, FALSE, WS_EX_APPWINDOW);
mmi->ptMinTrackSize.x = rect.right - rect.left;
mmi->ptMinTrackSize.y = rect.bottom - rect.top;
}
else
{
mmi->ptMinTrackSize.x = 320;
mmi->ptMinTrackSize.y = 200;
}
return 0;
}
break;