8 using std::runtime_error;
13 const Vector<int> Window::POS_CENTER(
14 SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
15 const Vector<int> Window::POS_UNDEF(
16 SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED);
24 : win(SDL_CreateWindow(title, pos.x, pos.y, size.x, size.y, flags)) {
26 throw runtime_error(std::string("create window ") + title
27 + ": " + SDL_GetError());
32 if (win) SDL_DestroyWindow(win);
35 Window::Window(Window &&other)
40 Window &Window::operator =(Window &&other) {
41 std::swap(win, other.win);
46 Vector<int> Window::Size() const {
49 SDL_GetWindowSize(win, &size.x, &size.y);
54 Canvas Window::CreateCanvas(Uint32 flags) {
55 return Canvas(win, -1, flags);