From 0efff48aa8fc41d8e08c9b8f8fde7e1889f92f7d Mon Sep 17 00:00:00 2001 From: Guillaume Jacquemin Date: Mon, 22 Apr 2019 11:17:41 +0200 Subject: [PATCH] Platform: add #ifdefs in GlfwApplication. Window size limits were added in GLFW 3.2,so we make it visible only in that case. --- src/Magnum/Platform/GlfwApplication.cpp | 2 ++ src/Magnum/Platform/GlfwApplication.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/Magnum/Platform/GlfwApplication.cpp b/src/Magnum/Platform/GlfwApplication.cpp index 10da11f29..59c8787fe 100644 --- a/src/Magnum/Platform/GlfwApplication.cpp +++ b/src/Magnum/Platform/GlfwApplication.cpp @@ -534,6 +534,7 @@ Vector2i GlfwApplication::windowSize() const { return size; } +#if (GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 302) void GlfwApplication::setMinWindowSize(const Vector2i& size) { CORRADE_ASSERT(_window, "Platform::GlfwApplication::setMinWindowSize(): no window opened", ); @@ -547,6 +548,7 @@ void GlfwApplication::setMaxWindowSize(const Vector2i& size) { glfwSetWindowSizeLimits(_window, _minWindowSize.x(), _minWindowSize.y(), size.x(), size.y()); _maxWindowSize = size; } +#endif #ifdef MAGNUM_TARGET_GL Vector2i GlfwApplication::framebufferSize() const { diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 5ca0b579c..e82c3e899 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -336,11 +336,14 @@ class GlfwApplication { */ Vector2i windowSize() const; + #if (GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 302) || defined(DOXYGEN_GENERATING_OUTPUT) /** * @brief Set window minimum size * @param size The minimum size, in screen coordinates. * * If a value is set to -1, it will disable/remove the corresponding limit. + * + * @note Supported since GLFW 3.2. */ void setMinWindowSize(const Vector2i& size = {-1, -1}); @@ -349,8 +352,11 @@ class GlfwApplication { * @param size The maximum size, in screen coordinates. * * If a value is set to -1, it will disable/remove the corresponding limit. + * + * @note Supported since GLFW 3.2. */ void setMaxWindowSize(const Vector2i& size = {-1, -1}); + #endif #if defined(MAGNUM_TARGET_GL) || defined(DOXYGEN_GENERATING_OUTPUT) /**