diff options
Diffstat (limited to 'backends/graphics/windowed.h')
-rw-r--r-- | backends/graphics/windowed.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h index b3e5b832b3..52bb96c2cf 100644 --- a/backends/graphics/windowed.h +++ b/backends/graphics/windowed.h @@ -36,6 +36,7 @@ public: _windowHeight(0), _overlayVisible(false), _forceRedraw(false), + _cursorVisible(false), _cursorX(0), _cursorY(0), _cursorNeedsRedraw(false) {} @@ -182,6 +183,17 @@ protected: */ virtual void setSystemMousePosition(const int x, const int y) = 0; + virtual bool showMouse(const bool visible) override { + if (_cursorVisible == visible) { + return visible; + } + + const bool last = _cursorVisible; + _cursorVisible = visible; + _cursorNeedsRedraw = true; + return last; + } + /** * Move ("warp") the mouse cursor to the specified position. * @@ -282,6 +294,11 @@ protected: bool _forceRedraw; /** + * Whether the cursor is actually visible. + */ + bool _cursorVisible; + + /** * Whether the mouse cursor needs to be redrawn on the next frame. */ bool _cursorNeedsRedraw; |