]> git.tdb.fi Git - libs/gui.git/blob - source/gbase/display.h
Hide the platform-specific parts of other classes as well
[libs/gui.git] / source / gbase / display.h
1 /* $Id$
2
3 This file is part of libmspgbase
4 Copyright © 2007-2008  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GBASE_DISPLAY_H_
9 #define MSP_GBASE_DISPLAY_H_
10
11 #include <list>
12 #include <map>
13 #include <string>
14
15 namespace Msp {
16 namespace Graphics {
17
18 class Window;
19
20 struct VideoMode
21 {
22         unsigned width;
23         unsigned height;
24         unsigned rate;
25
26         VideoMode(): width(0), height(0), rate(0) { }
27         VideoMode(unsigned w, unsigned h): width(w), height(h), rate(0) { }
28 };
29
30 class Display
31 {
32 public:
33         struct Private;
34
35 private:
36         std::list<VideoMode> modes;
37         VideoMode orig_mode;
38         Private *priv;
39
40 public:
41         Display(const std::string &disp_name=std::string());
42         ~Display();
43
44         const Private &get_private() const { return *priv; }
45
46         void add_window(Window &);
47         void remove_window(Window &);
48
49         const std::list<VideoMode> &get_modes() const { return modes; }
50         void set_mode(const VideoMode &);
51         void restore_mode() { set_mode(orig_mode); }
52
53         void tick();
54         void check_error();
55 };
56
57 } // namespace Graphics
58 } // namespace Msp
59
60 #endif