-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathConsole.hpp
More file actions
91 lines (71 loc) · 2.25 KB
/
Copy pathConsole.hpp
File metadata and controls
91 lines (71 loc) · 2.25 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef CPP3DS_CONSOLE_HPP
#define CPP3DS_CONSOLE_HPP
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <cpp3ds/System/NonCopyable.hpp>
#include <cpp3ds/Graphics/Drawable.hpp>
#include <cpp3ds/Graphics/Font.hpp>
#include <cpp3ds/Graphics/Text.hpp>
#include <cpp3ds/Window/ContextSettings.hpp>
namespace cpp3ds
{
extern std::vector<String> g_stdout;
////////////////////////////////////////////////////////////
/// \brief Class holding a valid drawing context
///
////////////////////////////////////////////////////////////
class Console : public Drawable
{
public:
////////////////////////////////////////////////////////////
/// \brief Destructor
///
/// The destructor deactivates and destroys the console
///
////////////////////////////////////////////////////////////
~Console();
void update(float delta);
void write(String text);
bool processEvent(Event& event);
void setVisible(bool visible);
static Console& getInstance();
static void enable(Screen screen, Color color = Color::White);
static void enableBasic(Screen screen);
static bool isEnabled();
static bool isEnabledBasic();
void setScreen(Screen screen);
Screen getScreen();
void setColor(const Color& color);
const Color& getColor() const;
private:
////////////////////////////////////////////////////////////
/// \brief Default constructor
///
/// The constructor creates and activates the context
///
////////////////////////////////////////////////////////////
Console();
////////////////////////////////////////////////////////////
/// \brief Draw the console to a render target
///
/// \param target Render target to draw to
/// \param states Current render states
///
////////////////////////////////////////////////////////////
virtual void draw(RenderTarget& target, RenderStates states) const;
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
Font m_font;
Color m_color;
std::vector<Text> m_lines;
Text m_memoryText;
unsigned int m_limit;
static bool m_enabled;
static bool m_enabledBasic;
bool m_visible;
Screen m_screen;
};
} // namespace cpp3ds
#endif // CPP3DS_CONSOLE_HPP