From f465b26a8aeac95cf7e0186a86ab1262dc771fb4 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 17 Dec 2018 19:31:38 +0100 Subject: Keep track of window size in its wrapper class --- src/glfw/window.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/glfw/window.cc') diff --git a/src/glfw/window.cc b/src/glfw/window.cc index 0e57a65..9e76b57 100644 --- a/src/glfw/window.cc +++ b/src/glfw/window.cc @@ -1,5 +1,15 @@ #include "window.h" +bool Window::updateSize() { + const int old_width = _width; + const int old_height = _height; + + glfwGetWindowSize(_handle, &_width, &_height); + + return old_width != _width + || old_height != _height; +} + Window::Window(const std::string& title): _handle(glfwCreateWindow(_width, _height, title.c_str(), NULL, NULL)) { if ( _handle != nullptr ) { -- cgit v1.2.3