From e7fc904cf41f614ed1e38db8d5b487d92bb17557 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 13 Feb 2021 21:26:12 +1000 Subject: [PATCH] DRMHostInterface: Set surface size to settings fullscreen mode --- src/duckstation-nogui/drm_host_interface.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/duckstation-nogui/drm_host_interface.cpp b/src/duckstation-nogui/drm_host_interface.cpp index b2e11a341..3ac5daf94 100644 --- a/src/duckstation-nogui/drm_host_interface.cpp +++ b/src/duckstation-nogui/drm_host_interface.cpp @@ -2,6 +2,7 @@ #include "common/log.h" #include "common/string_util.h" #include "evdev_key_names.h" +#include "frontend-common/ini_settings_interface.h" #include "imgui.h" #include #include @@ -71,12 +72,22 @@ void DRMHostInterface::DestroyPlatformWindow() std::optional DRMHostInterface::GetPlatformWindowInfo() { - // TODO: Set fullscreen resolution. WindowInfo wi; wi.type = WindowInfo::Type::Display; wi.surface_width = 0; wi.surface_height = 0; + wi.surface_refresh_rate = 0.0f; wi.surface_format = WindowInfo::SurfaceFormat::Auto; + + const std::string fullscreen_mode = m_settings_interface->GetStringValue("GPU", "FullscreenMode", ""); + if (!fullscreen_mode.empty()) + { + if (!ParseFullscreenMode(fullscreen_mode, &wi.surface_width, &wi.surface_height, &wi.surface_refresh_rate)) + { + Log_ErrorPrintf("Failed to parse fullscreen mode '%s'", fullscreen_mode.c_str()); + } + } + return wi; }