]> git.tdb.fi Git - libs/gui.git/blob - source/gbase/display.h
Drop Id tags and copyright notices from files
[libs/gui.git] / source / gbase / display.h
1 #ifndef MSP_GBASE_DISPLAY_H_
2 #define MSP_GBASE_DISPLAY_H_
3
4 #include <list>
5 #include <map>
6 #include <string>
7
8 namespace Msp {
9 namespace Graphics {
10
11 class Window;
12
13 struct VideoMode
14 {
15         unsigned width;
16         unsigned height;
17         unsigned rate;
18
19         VideoMode(): width(0), height(0), rate(0) { }
20         VideoMode(unsigned w, unsigned h): width(w), height(h), rate(0) { }
21 };
22
23 class Display
24 {
25 public:
26         struct Private;
27
28 private:
29         std::list<VideoMode> modes;
30         VideoMode orig_mode;
31         Private *priv;
32
33 public:
34         Display(const std::string &disp_name=std::string());
35         ~Display();
36
37         const Private &get_private() const { return *priv; }
38
39         void add_window(Window &);
40         void remove_window(Window &);
41
42         const std::list<VideoMode> &get_modes() const { return modes; }
43         void set_mode(const VideoMode &);
44         void restore_mode() { set_mode(orig_mode); }
45
46         void tick();
47         void check_error();
48 };
49
50 } // namespace Graphics
51 } // namespace Msp
52
53 #endif