]> git.tdb.fi Git - libs/gui.git/blob - source/graphics/display.h
370bf0dea81013c03d2212ae77e2cfabd9cb7981
[libs/gui.git] / source / graphics / display.h
1 #ifndef MSP_GRAPHICS_DISPLAY_H_
2 #define MSP_GRAPHICS_DISPLAY_H_
3
4 #include <list>
5 #include <stdexcept>
6 #include <string>
7 #include "videomode.h"
8
9 namespace Msp {
10 namespace Graphics {
11
12 class Window;
13
14 class Display
15 {
16 public:
17         struct Private;
18
19 private:
20         std::list<VideoMode> modes;
21         VideoMode orig_mode;
22         Private *priv;
23
24 public:
25         Display(const std::string &disp_name = std::string());
26         ~Display();
27
28         const Private &get_private() const { return *priv; }
29
30         void add_window(Window &);
31         void remove_window(Window &);
32
33         const std::list<VideoMode> &get_modes() const { return modes; }
34         const VideoMode &get_desktop_mode() const { return orig_mode; }
35         void set_mode(const VideoMode &);
36         void restore_mode() { set_mode(orig_mode); }
37
38         void tick();
39 private:
40         bool process_events();
41 public:
42         void check_error();
43 };
44
45 } // namespace Graphics
46 } // namespace Msp
47
48 #endif