summaryrefslogtreecommitdiff
path: root/src/sdlgraphics.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdlgraphics.h')
-rw-r--r--src/sdlgraphics.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/sdlgraphics.h b/src/sdlgraphics.h
index 6685fc83..ab6407f0 100644
--- a/src/sdlgraphics.h
+++ b/src/sdlgraphics.h
@@ -24,15 +24,22 @@
#include "graphics.h"
+#include <memory>
+
+class VideoSettings;
+
class SDLGraphics final : public Graphics
{
public:
- SDLGraphics(SDL_Window *window, SDL_Renderer *renderer);
+ static std::unique_ptr<Graphics> create(SDL_Window *window,
+ const VideoSettings &settings);
+
+ SDLGraphics(SDL_Renderer *renderer);
~SDLGraphics() override;
void setVSync(bool sync) override;
- void videoResized(int w, int h) override;
+ void updateSize(int windowWidth, int windowHeight, float scale) override;
bool drawRescaledImage(Image *image,
int srcX, int srcY,
@@ -49,6 +56,9 @@ public:
void updateScreen() override;
+ void windowToLogical(int windowX, int windowY,
+ float &logicalX, float &logicalY) const override;
+
SDL_Surface *getScreenshot() override;
bool pushClipArea(gcn::Rectangle area) override;
@@ -66,7 +76,6 @@ public:
private:
void updateSDLClipRect();
- SDL_Window *mWindow = nullptr;
SDL_Renderer *mRenderer = nullptr;
};