1 #include <msp/core/application.h>
4 #include "window_private.h"
11 WindowOptions::WindowOptions():
21 Window::Window(Display &dpy, unsigned w, unsigned h, bool fs):
26 options.fullscreen = fs;
31 Window::Window(Display &dpy, const WindowOptions &opts):
41 kbd_autorepeat = true;
48 display.add_window(*this);
49 display.check_error();
51 const string &app_name = Application::get_name();
60 display.remove_window(*this);
62 if(options.fullscreen && visible)
63 display.restore_mode();
68 void Window::reconfigure(const WindowOptions &opts)
70 bool fullscreen_changed = (opts.fullscreen!=options.fullscreen);
71 if(opts.width!=options.width || opts.height!=options.height)
77 display.set_mode(VideoMode(opts.width, opts.height));
78 else if(fullscreen_changed)
79 display.restore_mode();
83 platform_reconfigure(fullscreen_changed);
86 void Window::set_keyboard_autorepeat(bool r)
91 void Window::set_touch_input(bool t)
94 platform_set_touch_input();
102 if(options.fullscreen)
104 display.set_mode(VideoMode(options.width, options.height), true);
105 warp_pointer(options.width/2, options.height/2);
114 if(options.fullscreen)
115 display.restore_mode();
118 } // namespace Graphics