Console.hpp
1 #ifndef CPP3DS_CONSOLE_HPP
2 #define CPP3DS_CONSOLE_HPP
3 
5 // Headers
7 #include <cpp3ds/System/NonCopyable.hpp>
8 #include <cpp3ds/Graphics/Drawable.hpp>
9 #include <cpp3ds/Graphics/Font.hpp>
10 #include <cpp3ds/Graphics/Text.hpp>
11 #include <cpp3ds/Window/ContextSettings.hpp>
12 
13 namespace cpp3ds
14 {
15 
16 extern std::vector<String> g_stdout;
17 
22 class Console : public Drawable
23 {
24 public:
25 
32  Console();
33 
40  ~Console();
41 
42 public:
43 
44  void create(Screen screen = BottomScreen);
45 
46  void update(float delta);
47 
48  void write(String text);
49 
50  bool processEvent(Event& event);
51 
52  void setVisible(bool visible);
53 
54  static void initialize();
55 
56  void setScreen(Screen screen);
57 
58  Screen getScreen();
59 
60  void setColor(const Color& color);
61  const Color& getColor() const;
62 
63 private:
64 
72  virtual void draw(RenderTarget& target, RenderStates states) const;
73 
75  // Member data
77  Font m_font;
78  Color m_color;
79  std::vector<Text> m_lines;
80  Text m_memoryText;
81  unsigned int m_limit;
82  static bool m_initialized;
83  bool m_visible;
84  Screen m_screen;
85 };
86 
87 } // namespace cpp3ds
88 
89 
90 #endif // CPP3DS_CONSOLE_HPP
Class for loading and manipulating character fonts.
Definition: Font.hpp:49
Console()
Default constructor.
Utility string class that automatically handles conversions between types and encodings.
Definition: String.hpp:42
Class holding a valid drawing context.
Definition: Console.hpp:22
Utility class for manpulating RGBA colors.
Definition: Color.hpp:36
Graphical text that can be drawn to a render target.
Definition: Text.hpp:47
Abstract base class for objects that can be drawn to a render target.
Definition: Drawable.hpp:43
~Console()
Destructor.
Base class for all render targets (window, texture, ...)
Define the states used for drawing to a RenderTarget.
Defines a system event and its parameters.
Definition: Event.hpp:15