+#include <msp/core/application.h>
#include "display.h"
#include "window.h"
#include "window_private.h"
namespace Graphics {
WindowOptions::WindowOptions():
+ x(0),
+ y(0),
+ user_position(false),
width(640),
height(480),
fullscreen(false),
{
visible = false;
kbd_autorepeat = true;
+ touch_input = false;
resizing = false;
+ moving = false;
priv = new Private;
platform_init();
display.add_window(*this);
display.check_error();
+
+ const string &app_name = Application::get_name();
+ if(!app_name.empty())
+ set_title(app_name);
}
Window::~Window()
display.remove_window(*this);
- if(options.fullscreen)
+ if(options.fullscreen && visible)
display.restore_mode();
delete priv;
void Window::reconfigure(const WindowOptions &opts)
{
bool fullscreen_changed = (opts.fullscreen!=options.fullscreen);
- resizing = (opts.width!=options.width || opts.height!=options.height);
+ if(opts.width!=options.width || opts.height!=options.height)
+ resizing = true;
+ if(opts.x!=options.x || opts.y!=options.y)
+ moving = true;
if(visible)
{
kbd_autorepeat = r;
}
+void Window::set_touch_input(bool t)
+{
+ touch_input = t;
+ platform_set_touch_input();
+}
+
void Window::show()
{
platform_show();