From afa22dc6450a7f2341c432604d5e50735d6830c7 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 23 Jun 2022 20:16:07 +0200 Subject: perf: reduce cout flushing --- src/interfaces/cursor.hpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/interfaces/cursor.hpp') diff --git a/src/interfaces/cursor.hpp b/src/interfaces/cursor.hpp index b09f06f..35c3047 100644 --- a/src/interfaces/cursor.hpp +++ b/src/interfaces/cursor.hpp @@ -22,10 +22,12 @@ class ICursorController public: virtual ~ICursorController() noexcept = default; - virtual void move(const Vector2 &direction, const uint32_t &amount) noexcept = 0; + virtual void move( + const Vector2 &direction, + const uint32_t &amount, + bool flush_cout = false) noexcept = 0; - // NOLINTNEXTLINE(google-default-arguments) - virtual void move_to(const Vector2 &position) noexcept = 0; + virtual void move_to(const Vector2 &position, bool flush_cout = false) noexcept = 0; [[nodiscard]] virtual auto where() const noexcept -> Vector2 = 0; @@ -38,11 +40,12 @@ public: */ virtual void update_position(const Vector2 &position) noexcept = 0; - virtual void hide() noexcept = 0; + virtual void hide(bool flush_cout = false) noexcept = 0; - virtual void show() noexcept = 0; + virtual void show(bool flush_cout = false) noexcept = 0; - virtual void set_cursor_style(CursorStyle cursor_style) noexcept = 0; + virtual void + set_cursor_style(CursorStyle cursor_style, bool flush_cout = false) noexcept = 0; virtual void set_bounds(const Bounds &bounds) noexcept = 0; }; -- cgit v1.2.3-18-g5258