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)
55 display.restore_mode();
60 void Window::reconfigure(const WindowOptions &opts)
62 bool fullscreen_changed = (opts.fullscreen!=options.fullscreen);
63 resizing = (opts.width!=options.width || opts.height!=options.height);
66 platform_reconfigure(fullscreen_changed);
70 if(options.fullscreen)
71 display.set_mode(VideoMode(options.width, options.height));
72 else if(fullscreen_changed)
73 display.restore_mode();
77 void Window::set_keyboard_autorepeat(bool r)
87 if(options.fullscreen)
89 display.set_mode(VideoMode(options.width, options.height));
90 warp_pointer(options.width/2, options.height/2);
99 if(options.fullscreen)
100 display.restore_mode();
103 } // namespace Graphics