diff options
Diffstat (limited to 'src/graphics.h')
-rw-r--r-- | src/graphics.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/graphics.h b/src/graphics.h index 956e729d..91bb01cf 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -80,7 +80,10 @@ class Graphics : public gcn::Graphics */ virtual void setVSync(bool sync) = 0; - virtual void videoResized(int w, int h); + /** + * Called when the window size or scale has changed. + */ + virtual void updateSize(int width, int height, float scale); using gcn::Graphics::drawImage; @@ -161,14 +164,24 @@ class Graphics : public gcn::Graphics virtual void updateScreen() = 0; /** - * Returns the width of the screen. + * Returns the logical width of the screen. + */ + int getWidth() const { return mWidth; } + + /** + * Returns the logical height of the screen. */ - int getWidth() const; + int getHeight() const { return mHeight; } /** - * Returns the height of the screen. + * Converts a window coordinate to a logical coordinate. Used for + * converting mouse coordinates. */ - int getHeight() const; + virtual void windowToLogical(int windowX, int windowY, + float &logicalX, float &logicalY) const = 0; + + void _beginDraw() override; + void _endDraw() override; /** * Takes a screenshot and returns it as SDL surface. |