summaryrefslogtreecommitdiff
path: root/src/gui/setup_video.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-27 10:51:33 +0000
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-27 10:51:33 +0000
commit254c3db4a39aa35274fd7cd4ec2cccde5b92d71b (patch)
tree01c1b5ad71794c02b03d9c45f2c4b5043bc03163 /src/gui/setup_video.h
parent81e4f170d8ba4ccbcfa1e6c07bd0522dfc3b6e08 (diff)
downloadMana-254c3db4a39aa35274fd7cd4ec2cccde5b92d71b.tar.gz
Mana-254c3db4a39aa35274fd7cd4ec2cccde5b92d71b.tar.bz2
Mana-254c3db4a39aa35274fd7cd4ec2cccde5b92d71b.tar.xz
Mana-254c3db4a39aa35274fd7cd4ec2cccde5b92d71b.zip
Added VSync and windowed fullscreen options
The configuration and setup UI were adjusted to the new options. This also fixes issues in applying new video settings. Default resolution was changed from 800x600 to 1280x720. VSync is enabled by default while FPS limit was disabled. Display aspect ratio for the resolution options. I had to work around some macOS issues: * Don't change window size when it appears to be "maximized", since it just changes the rendering area while leaving the window maximized. * Unset fullscreen display mode temporarily to allow changing resolutions, otherwise the rendering area no longer matches the screen and mouse input is also off. * Removed SDL_WINDOW_ALLOW_HIGHDPI for now because it causes issues on macOS, since we're not actually handling the scaling factor. A Video class and an SDLGraphics subclass were split off from Graphics. This setup has Less duplication and leaves the OpenGLGraphics and SDLGraphics better separated. Fixes #57 Fixes #58
Diffstat (limited to 'src/gui/setup_video.h')
-rw-r--r--src/gui/setup_video.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h
index 6c902bb7..d16f6d73 100644
--- a/src/gui/setup_video.h
+++ b/src/gui/setup_video.h
@@ -25,11 +25,12 @@
#include "guichanfwd.h"
#include "gui/widgets/setuptab.h"
+#include "video.h"
#include <guichan/actionlistener.hpp>
#include <guichan/keylistener.hpp>
-class ModeListModel;
+class ResolutionListModel;
class Setup_Video : public SetupTab, public gcn::ActionListener,
public gcn::KeyListener
@@ -43,27 +44,24 @@ class Setup_Video : public SetupTab, public gcn::ActionListener,
void action(const gcn::ActionEvent &event) override;
- static const char *overlayDetailToString(int detail = -1);
-
- static const char *particleDetailToString(int detail = -1);
-
private:
- bool mFullScreenEnabled;
- bool mOpenGLEnabled;
+ VideoSettings mVideoSettings;
bool mCustomCursorEnabled;
bool mParticleEffectsEnabled;
int mFps;
bool mSDLTransparencyDisabled;
- ModeListModel *mModeListModel;
+ std::unique_ptr<gcn::ListModel> mWindowModeListModel;
+ std::unique_ptr<ResolutionListModel> mResolutionListModel;
//gcn::Label *scrollRadiusLabel;
//gcn::Label *scrollLazinessLabel;
gcn::Label *overlayDetailLabel;
gcn::Label *particleDetailLabel;
- gcn::ListBox *mModeList;
- gcn::CheckBox *mFsCheckBox;
+ gcn::DropDown *mWindowModeDropDown;
+ gcn::DropDown *mResolutionDropDown;
+ gcn::CheckBox *mVSyncCheckBox;
gcn::CheckBox *mOpenGLCheckBox;
gcn::CheckBox *mCustomCursorCheckBox;
gcn::CheckBox *mParticleEffectsCheckBox;