From b14927aa61163ff8ebd1dc7ffb5db3a6c0d56afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 19 Feb 2017 22:28:44 +0100 Subject: [PATCH] Platform: added {Sdl2,Glfw}Application::window(). --- src/Magnum/Platform/GlfwApplication.h | 7 +++++++ src/Magnum/Platform/Sdl2Application.h | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 279e942f9..69eb48ce8 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -150,6 +150,13 @@ class GlfwApplication { glfwSetWindowShouldClose(_window, true); } + /** + * @brief Underlying window handle + * + * Use in case you need to call GLFW functionality directly. + */ + GLFWwindow* window() { return _window; } + protected: /* Nobody will need to have (and delete) GlfwApplication*, thus this is faster than public pure virtual destructor */ diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index c15d522d2..4a7e47c68 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -386,6 +386,16 @@ class Sdl2Application { /** @brief Exit application main loop */ void exit(); + #ifndef CORRADE_TARGET_EMSCRIPTEN + /** + * @brief Underlying window handle + * + * Use in case you need to call SDL functionality directly. + * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". + */ + SDL_Window* window() { return _window; } + #endif + protected: /* Nobody will need to have (and delete) Sdl2Application*, thus this is faster than public pure virtual destructor */