display.check_error();
}
+void Window::reconfigure(const WindowOptions &opts)
+{
+ bool fullscreen_changed=(opts.fullscreen!=options.fullscreen);
+
+ options=opts;
+
+ ::Display *dpy=display.get_display();
+
+ XMoveResizeWindow(dpy, window, 0, 0, options.width, options.height);
+
+ if(fullscreen_changed)
+ {
+ hide();
+ XSetWindowAttributes attr;
+ attr.override_redirect=options.fullscreen;
+ XChangeWindowAttributes(dpy, window, CWOverrideRedirect, &attr);
+ show();
+ }
+
+ if(options.fullscreen)
+ display.set_mode(VideoMode(options.width, options.height));
+ else if(fullscreen_changed)
+ display.restore_mode();
+}
+
void Window::show()
{
XMapRaised(display.get_display(), window);
~Window();
void set_title(const std::string &);
+ void reconfigure(const WindowOptions &);
+ const WindowOptions &get_options() const { return options; }
unsigned get_width() const { return options.width; }
unsigned get_height() const { return options.height; }
WindowHandle get_handle() const { return window; }