diff --git a/Window.cpp b/Window.cpp index 5070352..002c6b2 100644 --- a/Window.cpp +++ b/Window.cpp @@ -143,3 +143,15 @@ bool Window::handle_event(const SDL_Event& event, bool quit) { } return quit; } + +int Window::width() const { + int w, h; + SDL_GetWindowSize(_w.get(), &w, &h); + return w; +} + +int Window::height() const { + int w, h; + SDL_GetWindowSize(_w.get(), &w, &h); + return h; +} diff --git a/Window.hpp b/Window.hpp index 26f7187..312041a 100644 --- a/Window.hpp +++ b/Window.hpp @@ -40,6 +40,8 @@ namespace sc { SDL_Texture* texture() const { return _t.get(); } void set_size(int w, int h); + int width() const; + int height() const; void update() const; void show_image(const Image& image);