blob: a8e7b88cd1234af157af876c1f25304bc775819b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#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(matrix_factory)
{
}
void Scene::enter()
{
if (_is_shown)
{
return;
}
fmt::print(ENABLE_ALT_BUFFER, fmt::arg("esc", ESC));
std::cout.flush();
_is_shown = true;
}
void Scene::leave()
{
if (!_is_shown)
{
return;
}
fmt::print(DISABLE_ALT_BUFFER, fmt::arg("esc", ESC));
std::cout.flush();
_is_shown = false;
}
|