1 #include <msp/core/application.h>
4 #include "window_private.h"
11 WindowOptions::WindowOptions():
19 Window::Window(Display &dpy, unsigned w, unsigned h, bool fs):
24 options.fullscreen = fs;
29 Window::Window(Display &dpy, const WindowOptions &opts):
39 kbd_autorepeat = true;
46 display.add_window(*this);
47 display.check_error();
49 const string &app_name = Application::get_name();
58 display.remove_window(*this);
60 if(options.fullscreen && visible)
61 display.restore_mode();
66 void Window::reconfigure(const WindowOptions &opts)
68 bool fullscreen_changed = (opts.fullscreen!=options.fullscreen);
69 if(opts.width!=options.width || opts.height!=options.height)
75 display.set_mode(VideoMode(opts.width, opts.height));
76 else if(fullscreen_changed)
77 display.restore_mode();
81 platform_reconfigure(fullscreen_changed);
84 void Window::set_keyboard_autorepeat(bool r)
89 void Window::set_touch_input(bool t)
92 platform_set_touch_input();
100 if(options.fullscreen)
102 display.set_mode(VideoMode(options.width, options.height), true);
103 warp_pointer(options.width/2, options.height/2);
112 if(options.fullscreen)
113 display.restore_mode();
116 } // namespace Graphics