From f3e0a852d5c10b08995d76e07b151d595a366c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 2 Aug 2019 13:23:03 +0200 Subject: [PATCH] Platform: make Screen::{focus,blur}Event() optional to implement. --- src/Magnum/Platform/Screen.h | 4 ++-- src/Magnum/Platform/ScreenedApplication.hpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Platform/Screen.h b/src/Magnum/Platform/Screen.h index 6d8ccd1b3..9f993c866 100644 --- a/src/Magnum/Platform/Screen.h +++ b/src/Magnum/Platform/Screen.h @@ -283,7 +283,7 @@ template class BasicScreen: * Called when screen is focused using @ref BasicScreenedApplication::focusScreen() * or @ref BasicScreenedApplication::addScreen(). */ - virtual void focusEvent() = 0; + virtual void focusEvent(); /** * @brief Blur event @@ -292,7 +292,7 @@ template class BasicScreen: * @ref BasicScreenedApplication::addScreen() or before the screen is * removed from application using @ref BasicScreenedApplication::removeScreen(). */ - virtual void blurEvent() = 0; + virtual void blurEvent(); /** * @brief Viewport event diff --git a/src/Magnum/Platform/ScreenedApplication.hpp b/src/Magnum/Platform/ScreenedApplication.hpp index 079b4f3ad..9a2263346 100644 --- a/src/Magnum/Platform/ScreenedApplication.hpp +++ b/src/Magnum/Platform/ScreenedApplication.hpp @@ -108,6 +108,9 @@ true>::textEditingEvent(TextEditingEvent&) {} template BasicScreen::BasicScreen() = default; template BasicScreen::~BasicScreen() = default; +template void BasicScreen::focusEvent() {} +template void BasicScreen::blurEvent() {} + template void BasicScreen::viewportEvent(ViewportEvent& event) { #ifdef MAGNUM_BUILD_DEPRECATED CORRADE_IGNORE_DEPRECATED_PUSH