diff --git a/SDL2pp/Window.cc b/SDL2pp/Window.cc index f6458ac..6ddf9f3 100644 --- a/SDL2pp/Window.cc +++ b/SDL2pp/Window.cc @@ -46,6 +46,24 @@ Window& Window::operator=(Window&& other) noexcept { return *this; } +Point Window::GetSize() const { + int w, h; + SDL_GetWindowSize(window_, &w, &h); + return Point(w, h); +} + +int Window::GetWidth() const { + int w, h; + SDL_GetWindowSize(window_, &w, &h); + return w; +} + +int Window::GetHeight() const { + int w, h; + SDL_GetWindowSize(window_, &w, &h); + return h; +} + SDL_Window* Window::Get() const { return window_; } diff --git a/SDL2pp/Window.hh b/SDL2pp/Window.hh index b3e7f66..e46de2e 100644 --- a/SDL2pp/Window.hh +++ b/SDL2pp/Window.hh @@ -24,6 +24,8 @@ #include +#include + struct SDL_Window; namespace SDL2pp { @@ -41,6 +43,10 @@ public: Window& operator=(const Window& other) = delete; Window& operator=(Window&& other) noexcept; + Point GetSize() const; + int GetWidth() const; + int GetHeight() const; + SDL_Window* Get() const; };