summaryrefslogtreecommitdiff
path: root/src/client.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/client.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/client.h')
-rw-r--r--src/client.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/client.h b/src/client.h
index 09233a5c..fe202ccc 100644
--- a/src/client.h
+++ b/src/client.h
@@ -23,6 +23,7 @@
#define CLIENT_H
#include "eventlistener.h"
+#include "video.h"
#include "net/serverinfo.h"
@@ -191,17 +192,15 @@ public:
static const std::string &getScreenshotDirectory()
{ return instance()->mScreenshotDir; }
+ static Video &getVideo()
+ { return instance()->mVideo; }
+
void event(Event::Channel channel, const Event &event) override;
void action(const gcn::ActionEvent &event) override;
/**
- * Should be called after the window has been resized by the user.
- */
- void handleVideoResize(int width, int height);
-
- /**
- * Should be called after a succesful resize or change of resolution, makes
- * sure the GUI and game adapt to the new size.
+ * Should be called after the window has been resized. Makes sure the GUI
+ * and game adapt to the new size.
*/
void videoResized(int width, int height);
@@ -231,6 +230,7 @@ private:
std::string mRootDir;
ServerInfo mCurrentServer;
+ Video mVideo;
Game *mGame;
Window *mCurrentDialog;