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;
45 display.add_window(*this);
46 display.check_error();
48 const string &app_name = Application::get_name();
57 display.remove_window(*this);
59 if(options.fullscreen && visible)
60 display.restore_mode();
65 void Window::reconfigure(const WindowOptions &opts)
67 bool fullscreen_changed = (opts.fullscreen!=options.fullscreen);
68 if(opts.width!=options.width || opts.height!=options.height)
74 display.set_mode(VideoMode(opts.width, opts.height));
75 else if(fullscreen_changed)
76 display.restore_mode();
80 platform_reconfigure(fullscreen_changed);
83 void Window::set_keyboard_autorepeat(bool r)
93 if(options.fullscreen)
95 display.set_mode(VideoMode(options.width, options.height), true);
96 warp_pointer(options.width/2, options.height/2);
105 if(options.fullscreen)
106 display.restore_mode();
109 } // namespace Graphics