summaryrefslogtreecommitdiff
path: root/src/video/win32_v.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-01-14 21:53:06 +0100
committerGitHub <noreply@github.com>2021-01-14 21:53:06 +0100
commitfa60c1f8b94dd5584a5d5331de277ca23a203422 (patch)
tree7849166d1c2ee40f4d48f4fc4442af1ee24b3b2f /src/video/win32_v.cpp
parent711723d7387df67b1abe98ca9ed4d7f2bd7de57d (diff)
downloadopenttd-fa60c1f8b94dd5584a5d5331de277ca23a203422.tar.xz
Feature: Choose a sensible window size on a fresh OTTD config file. (#8536)
Diffstat (limited to 'src/video/win32_v.cpp')
-rw-r--r--src/video/win32_v.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 29b85985f..e7e89fd73 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -1114,6 +1114,8 @@ static FVideoDriver_Win32 iFVideoDriver_Win32;
const char *VideoDriver_Win32::Start(const StringList &parm)
{
+ this->UpdateAutoResolution();
+
memset(&_wnd, 0, sizeof(_wnd));
RegisterWndClass();
@@ -1343,3 +1345,8 @@ void VideoDriver_Win32::EditBoxLostFocus()
SetCompositionPos(_wnd.main_wnd);
SetCandidatePos(_wnd.main_wnd);
}
+
+Dimension VideoDriver_Win32::GetScreenSize() const
+{
+ return { static_cast<uint>(GetSystemMetrics(SM_CXSCREEN)), static_cast<uint>(GetSystemMetrics(SM_CYSCREEN)) };
+}