]> git.tdb.fi Git - libs/gui.git/blob - source/graphics/display.cpp
42b0e8bb773404c892b01896d8ca13a589fa6f73
[libs/gui.git] / source / graphics / display.cpp
1 #include <msp/strings/format.h>
2 #include "display.h"
3 #include "display_private.h"
4 #include "window.h"
5
6 using namespace std;
7
8 namespace Msp {
9 namespace Graphics {
10
11 unsupported_video_mode::unsupported_video_mode(const VideoMode &mode):
12         runtime_error(format("%dx%d", mode.width, mode.height))
13 { }
14
15
16 void Display::add_window(Window &wnd)
17 {
18         priv->windows[wnd.get_private().window] = &wnd;
19 }
20
21 void Display::remove_window(Window &wnd)
22 {
23         priv->windows.erase(wnd.get_private().window);
24 }
25
26 void Display::tick()
27 {
28         check_error();
29
30         while(process_events()) ;
31 }
32
33 } // namespace Graphics
34 } // namespace Msp