From 617c3f2288494fe9d2efbb48564bc83ef8bf7e28 Mon Sep 17 00:00:00 2001 From: Alexa Wolfe Date: Fri, 5 Aug 2016 22:49:26 +0200 Subject: [PATCH] Get default resolution from Windows desktop resolution --- Gunz/ZConfiguration.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Gunz/ZConfiguration.cpp b/Gunz/ZConfiguration.cpp index 3ed21baa..29ffb2dd 100644 --- a/Gunz/ZConfiguration.cpp +++ b/Gunz/ZConfiguration.cpp @@ -933,8 +933,14 @@ bool ZConfiguration::SaveToFile(const char *szFileName, const char* szHeader) void ZConfiguration::Init() { m_Video.bFullScreen = false; - m_Video.nWidth = 1024; - m_Video.nHeight = 768; + auto Width = GetSystemMetrics(SM_CXSCREEN); + if (Width == 0) + Width = 1024; + auto Height = GetSystemMetrics(SM_CYSCREEN); + if (Height == 0) + Height = 768; + m_Video.nWidth = Width; + m_Video.nHeight = Height; m_Video.nColorBits = 32; m_Video.nGamma = 255; m_Video.bShader = true;