From 93123e97251fc791c1cac193d675cce9a1ac2de6 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 3 Mar 2022 19:41:23 +0100 Subject: feat: add moving cursor --- src/engine/graphics/scene.cpp | 26 +++----------------------- src/engine/graphics/scene.hpp | 2 -- 2 files changed, 3 insertions(+), 25 deletions(-) (limited to 'src/engine/graphics') diff --git a/src/engine/graphics/scene.cpp b/src/engine/graphics/scene.cpp index 3f63807..a8e7b88 100644 --- a/src/engine/graphics/scene.cpp +++ b/src/engine/graphics/scene.cpp @@ -1,10 +1,12 @@ #include "scene.hpp" +#include "engine/escape.hpp" + #include #include Scene::Scene(IMatrixFactory matrix_factory) - : _is_shown(false), _matrix_factory(std::move(matrix_factory)) + : _is_shown(false), _matrix_factory(matrix_factory) { } @@ -33,25 +35,3 @@ void Scene::leave() _is_shown = false; } - -/* -void do_in_statusbar(const std::function &routine) -{ - const auto prev_pos = Cursor::where(); - - const auto window_size = Window::size(); - - Cursor::hide(); - - Cursor::move_to(Vector2({1, window_size.height()})); - - std::cout << fmt::format(EscapeSequences::ERASE_LINE, fmt::arg("esc", ESC)); - std::cout.flush(); - - routine(); - - Cursor::move_to(prev_pos); - - Cursor::show(); -} -*/ diff --git a/src/engine/graphics/scene.hpp b/src/engine/graphics/scene.hpp index b26ac05..c4c217f 100644 --- a/src/engine/graphics/scene.hpp +++ b/src/engine/graphics/scene.hpp @@ -7,8 +7,6 @@ #include #include -constexpr fmt::string_view ESC = "\x1B"; - constexpr fmt::string_view ENABLE_ALT_BUFFER = "{esc}[?1049h"; constexpr fmt::string_view DISABLE_ALT_BUFFER = "{esc}[?1049l"; -- cgit v1.2.3-18-g5258