3 #include "window_private.h"
10 WindowOptions::WindowOptions():
18 Window::Window(Display &dpy, unsigned w, unsigned h, bool fs):
23 options.fullscreen = fs;
28 Window::Window(Display &dpy, const WindowOptions &opts):
38 kbd_autorepeat = true;
44 display.add_window(*this);
45 display.check_error();
52 display.remove_window(*this);
54 if(options.fullscreen && visible)
55 display.restore_mode();
60 void Window::reconfigure(const WindowOptions &opts)
62 bool fullscreen_changed = (opts.fullscreen!=options.fullscreen);
63 if(opts.width!=options.width || opts.height!=options.height)
69 display.set_mode(VideoMode(opts.width, opts.height));
70 else if(fullscreen_changed)
71 display.restore_mode();
75 platform_reconfigure(fullscreen_changed);
78 void Window::set_keyboard_autorepeat(bool r)
88 if(options.fullscreen)
90 display.set_mode(VideoMode(options.width, options.height), true);
91 warp_pointer(options.width/2, options.height/2);
100 if(options.fullscreen)
101 display.restore_mode();
104 } // namespace Graphics