Resize framebuffer in windowed mode to match the client area
This commit is contained in:
parent
02e4ba464a
commit
d3d8180f57
4 changed files with 70 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue