From 9aa4e69db0edf1141f3e71d0c3c763ee67203b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 19 Feb 2017 21:06:31 +0100 Subject: [PATCH] Platform: added GlfwApplication::windowSize(). --- src/Magnum/Platform/GlfwApplication.cpp | 6 ++++++ src/Magnum/Platform/GlfwApplication.h | 11 +++++++++++ 2 files changed, 17 insertions(+) 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 *