From fd137f3cf1a8395bcced3fc19a55111d71994e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 26 May 2019 18:55:02 +0200 Subject: [PATCH] Platform: make EmscriptenApplication work correctly w/o TARGET_GL. --- src/Magnum/Platform/EmscriptenApplication.cpp | 2 ++ src/Magnum/Platform/EmscriptenApplication.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/Magnum/Platform/EmscriptenApplication.cpp b/src/Magnum/Platform/EmscriptenApplication.cpp index d7dcf3019..a6f8636b3 100644 --- a/src/Magnum/Platform/EmscriptenApplication.cpp +++ b/src/Magnum/Platform/EmscriptenApplication.cpp @@ -477,8 +477,10 @@ void EmscriptenApplication::mouseMoveEvent(MouseMoveEvent&) {} void EmscriptenApplication::mouseScrollEvent(MouseScrollEvent&) {} void EmscriptenApplication::textInputEvent(TextInputEvent&) {} +#ifdef MAGNUM_TARGET_GL EmscriptenApplication::GLConfiguration::GLConfiguration(): _colorBufferSize{8, 8, 8, 0}, _depthBufferSize{24}, _stencilBufferSize{0} {} +#endif void EmscriptenApplication::mainLoopIteration() { /* The resize event is not fired on window resize, so poll for the canvas diff --git a/src/Magnum/Platform/EmscriptenApplication.h b/src/Magnum/Platform/EmscriptenApplication.h index bc3b1cba3..bd4f1e718 100644 --- a/src/Magnum/Platform/EmscriptenApplication.h +++ b/src/Magnum/Platform/EmscriptenApplication.h @@ -513,10 +513,16 @@ class EmscriptenApplication { CORRADE_ENUMSET_OPERATORS(EmscriptenApplication::Flags) +#ifdef MAGNUM_TARGET_GL /** @brief WebGL context configuration The created context is always with a double-buffered OpenGL context. + +@note This function is available only if Magnum is compiled with + @ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features + for more information. + @see @ref EmscriptenApplication(), @ref Configuration, @ref create(), @ref tryCreate() */ @@ -713,6 +719,7 @@ class EmscriptenApplication::GLConfiguration { }; CORRADE_ENUMSET_OPERATORS(EmscriptenApplication::GLConfiguration::Flags) +#endif /** @brief Configuration