]> git.tdb.fi Git - libs/gui.git/blob - source/display.h
0433eab22404163996491fa5ca772732f750b09a
[libs/gui.git] / source / display.h
1 /* $Id$
2
3 This file is part of libmspgbase
4 Copyright © 2007 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 #include "types.h"
15
16 namespace Msp {
17 namespace Graphics {
18
19 class Window;
20
21 struct VideoMode
22 {
23         unsigned width;
24         unsigned height;
25         unsigned rate;
26 };
27
28 class Display
29 {
30 private:
31         ::Display *display;
32         std::list<VideoMode> modes;
33         std::map<WindowHandle, Window *> windows;
34
35 public:
36         Display(const std::string &disp_name=std::string());
37         ~Display();
38
39         ::Display *get_display() const { return display; }
40
41         void add_window(Window *);
42         void remove_window(Window *);
43
44         const std::list<VideoMode> &get_modes() const { return modes; }
45         void set_mode(const VideoMode &);
46
47         void tick();
48         void check_error();
49 };
50
51 } // namespace Graphics
52 } // namespace Msp
53
54 #endif