diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-03 19:41:23 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:54 +0200 |
commit | 93123e97251fc791c1cac193d675cce9a1ac2de6 (patch) | |
tree | 4486453695d6f715e767bd91bcee89c92f54f7ba /src/engine/graphics | |
parent | 70b21e90d7be4d892b7d17440d64630e7ee1a575 (diff) |
feat: add moving cursor
Diffstat (limited to 'src/engine/graphics')
-rw-r--r-- | src/engine/graphics/scene.cpp | 26 | ||||
-rw-r--r-- | src/engine/graphics/scene.hpp | 2 |
2 files changed, 3 insertions, 25 deletions
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 <fmt/core.h> #include <iostream> Scene::Scene(IMatrixFactory<std::string_view> 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<void()> &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 <fmt/core.h> #include <string_view> -constexpr fmt::string_view ESC = "\x1B"; - constexpr fmt::string_view ENABLE_ALT_BUFFER = "{esc}[?1049h"; constexpr fmt::string_view DISABLE_ALT_BUFFER = "{esc}[?1049l"; |