Browse Source

Platform: add #ifdefs in GlfwApplication.

Window size limits were added in GLFW 3.2,so we make it visible only in
that case.
pull/335/head
Guillaume Jacquemin 7 years ago
parent
commit
0efff48aa8
  1. 2
      src/Magnum/Platform/GlfwApplication.cpp
  2. 6
      src/Magnum/Platform/GlfwApplication.h

2
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 {

6
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)
/**

Loading…
Cancel
Save