Browse Source

Platform: check for presence of GLFW cursor defines instead of a version.

Makes this work on older Git clones which have version set as 3.4 but
don't contain those defines yet.
pull/418/head
Vladimír Vondruš 6 years ago
parent
commit
31a7c4f66e
  1. 4
      src/Magnum/Platform/GlfwApplication.cpp
  2. 8
      src/Magnum/Platform/GlfwApplication.h

4
src/Magnum/Platform/GlfwApplication.cpp

@ -710,13 +710,13 @@ constexpr Int CursorMap[] {
GLFW_ARROW_CURSOR, GLFW_ARROW_CURSOR,
GLFW_IBEAM_CURSOR, GLFW_IBEAM_CURSOR,
GLFW_CROSSHAIR_CURSOR, GLFW_CROSSHAIR_CURSOR,
#if GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 304 #ifdef GLFW_RESIZE_NWSE_CURSOR
GLFW_RESIZE_NWSE_CURSOR, GLFW_RESIZE_NWSE_CURSOR,
GLFW_RESIZE_NESW_CURSOR, GLFW_RESIZE_NESW_CURSOR,
#endif #endif
GLFW_HRESIZE_CURSOR, GLFW_HRESIZE_CURSOR,
GLFW_VRESIZE_CURSOR, GLFW_VRESIZE_CURSOR,
#if GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 304 #ifdef GLFW_RESIZE_NWSE_CURSOR
GLFW_RESIZE_ALL_CURSOR, GLFW_RESIZE_ALL_CURSOR,
GLFW_NOT_ALLOWED_CURSOR, GLFW_NOT_ALLOWED_CURSOR,
#endif #endif

8
src/Magnum/Platform/GlfwApplication.h

@ -562,7 +562,11 @@ class GlfwApplication {
TextInput, /**< Text input */ TextInput, /**< Text input */
Crosshair, /**< Crosshair */ Crosshair, /**< Crosshair */
#if defined(DOXYGEN_GENERATING_OUTPUT) || GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 304 /* Checking for GLFW_RESIZE_NWSE_CURSOR being defined instead of a
version check because older Git clones have version set to 3.4
but don't contain those defines. All new cursors were added in
the same commit, so it's okay to test for just one define. */
#if defined(DOXYGEN_GENERATING_OUTPUT) || defined(GLFW_RESIZE_NWSE_CURSOR)
/** /**
* Double arrow pointing northwest and southeast * Double arrow pointing northwest and southeast
* @note Available since GLFW 3.4. * @note Available since GLFW 3.4.
@ -579,7 +583,7 @@ class GlfwApplication {
ResizeWE, /**< Double arrow pointing west and east */ ResizeWE, /**< Double arrow pointing west and east */
ResizeNS, /**< Double arrow pointing north and south */ ResizeNS, /**< Double arrow pointing north and south */
#if defined(DOXYGEN_GENERATING_OUTPUT) || GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 304 #if defined(DOXYGEN_GENERATING_OUTPUT) || defined(GLFW_RESIZE_NWSE_CURSOR)
/** /**
* Four pointed arrow pointing north, south, east, and west * Four pointed arrow pointing north, south, east, and west
* @note Available since GLFW 3.4. * @note Available since GLFW 3.4.

Loading…
Cancel
Save