1 #include <msp/core/application.h>
4 #include "window_private.h"
11 WindowOptions::WindowOptions():
22 Window::Window(Display &dpy, unsigned w, unsigned h, bool fs):
27 options.fullscreen = fs;
32 Window::Window(Display &dpy, const WindowOptions &opts):
42 kbd_autorepeat = true;
50 display.add_window(*this);
51 display.check_error();
53 const string &app_name = Application::get_name();
62 display.remove_window(*this);
64 if(options.fullscreen && visible)
65 display.restore_mode();
70 void Window::reconfigure(const WindowOptions &opts)
72 bool fullscreen_changed = (opts.fullscreen!=options.fullscreen);
73 if(opts.width!=options.width || opts.height!=options.height)
75 if(opts.x!=options.x || opts.y!=options.y)
81 display.set_mode(VideoMode(opts.width, opts.height));
82 else if(fullscreen_changed)
83 display.restore_mode();
87 platform_reconfigure(fullscreen_changed);
90 void Window::set_keyboard_autorepeat(bool r)
95 void Window::set_touch_input(bool t)
98 platform_set_touch_input();
106 if(options.fullscreen)
108 display.set_mode(VideoMode(options.width, options.height), true);
109 warp_pointer(options.width/2, options.height/2);
118 if(options.fullscreen)
119 display.restore_mode();
122 } // namespace Graphics