From a06db62288bc3fdbf3f25bcfa046c20510036665 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Tue, 5 Mar 2024 10:21:43 +0100 Subject: Added support for scaling the output * Added "Scale" user option, which can either by "Auto" or an explicit scaling factor. Its maximum value depends on the current resolution. The "Auto" factor is based on keeping the logical resolution on at least 800x600, wheres the maximum scale is based on keeping the logical resolution on at least 640x480. * Enabled support for High DPI. This means the rendering target can now have a different resolution than the window size, which can happen on macOS, Windows and Wayland. The resulting scale is multiplied by the above user-controlled scale. Currently, this looks ugly for non-integer scales, which are not used on macOS and can only be configured on some Wayland compositors. Has not been tested on Windows. * Simplified OpenGL initialization (moved out of _beginDraw). * Made sure _beginDraw/_endDraw sets a clip area also for SDLGraphics. --- src/gui/setup_video.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gui/setup_video.h') diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h index d16f6d73..0914f6b1 100644 --- a/src/gui/setup_video.h +++ b/src/gui/setup_video.h @@ -31,6 +31,7 @@ #include class ResolutionListModel; +class ScaleListModel; class Setup_Video : public SetupTab, public gcn::ActionListener, public gcn::KeyListener @@ -45,6 +46,8 @@ class Setup_Video : public SetupTab, public gcn::ActionListener, void action(const gcn::ActionEvent &event) override; private: + void refreshScaleList(); + VideoSettings mVideoSettings; bool mCustomCursorEnabled; bool mParticleEffectsEnabled; @@ -53,6 +56,7 @@ class Setup_Video : public SetupTab, public gcn::ActionListener, std::unique_ptr mWindowModeListModel; std::unique_ptr mResolutionListModel; + std::unique_ptr mScaleListModel; //gcn::Label *scrollRadiusLabel; //gcn::Label *scrollLazinessLabel; @@ -61,6 +65,7 @@ class Setup_Video : public SetupTab, public gcn::ActionListener, gcn::DropDown *mWindowModeDropDown; gcn::DropDown *mResolutionDropDown; + gcn::DropDown *mScaleDropDown; gcn::CheckBox *mVSyncCheckBox; gcn::CheckBox *mOpenGLCheckBox; gcn::CheckBox *mCustomCursorCheckBox; -- cgit v1.2.3-70-g09d2