diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index ef46be6c5..3b8539e87 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -150,6 +150,12 @@ GlfwApplication::~GlfwApplication() { glfwTerminate(); } +Vector2i GlfwApplication::windowSize() { + Vector2i size; + glfwGetWindowSize(_window, &size.x(), &size.y()); + return size; +} + void GlfwApplication::setSwapInterval(const Int interval) { glfwSwapInterval(interval); } diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index fae1fbcde..1379663e2 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -167,6 +167,17 @@ class GlfwApplication { /** @{ @name Screen handling */ + #ifndef CORRADE_TARGET_EMSCRIPTEN + /** + * @brief Window size + * + * Window size to which all input event coordinates can be related. + * Note that especially on HiDPI systems the reported window size might + * not be the same as framebuffer size. + */ + Vector2i windowSize(); + #endif + /** * @brief Swap buffers *