Browse Source

Platform: don't group special events together with screen events.

pull/308/head
Vladimír Vondruš 7 years ago
parent
commit
b9342665b2
  1. 26
      src/Magnum/Platform/GlfwApplication.h
  2. 56
      src/Magnum/Platform/Sdl2Application.h

26
src/Magnum/Platform/GlfwApplication.h

@ -423,17 +423,6 @@ class GlfwApplication {
void redraw() { _flags |= Flag::Redraw; } void redraw() { _flags |= Flag::Redraw; }
private: private:
/**
* @brief Exit event
*
* If implemented, it allows the application to react to an application
* exit (for example to save its internal state) and suppress it as
* well (for example to show a exit confirmation dialog). The default
* implementation calls @ref ExitEvent::setAccepted() on @p event,
* which tells the application that it's safe to exit.
*/
virtual void exitEvent(ExitEvent& event);
/** /**
* @brief Viewport event * @brief Viewport event
* *
@ -548,6 +537,21 @@ class GlfwApplication {
/*@}*/ /*@}*/
/** @{ @name Special events */
/**
* @brief Exit event
*
* If implemented, it allows the application to react to an application
* exit (for example to save its internal state) and suppress it as
* well (for example to show a exit confirmation dialog). The default
* implementation calls @ref ExitEvent::setAccepted() on @p event,
* which tells the application that it's safe to exit.
*/
virtual void exitEvent(ExitEvent& event);
/*@}*/
private: private:
enum class Flag: UnsignedByte { enum class Flag: UnsignedByte {
Redraw = 1 << 0, Redraw = 1 << 0,

56
src/Magnum/Platform/Sdl2Application.h

@ -734,32 +734,6 @@ class Sdl2Application {
void redraw() { _flags |= Flag::Redraw; } void redraw() { _flags |= Flag::Redraw; }
private: private:
/**
* @brief Exit event
*
* If implemented, it allows the application to react to an application
* exit (for example to save its internal state) and suppress it as
* well (for example to show a exit confirmation dialog). The default
* implementation calls @ref ExitEvent::setAccepted() on @p event,
* which tells the application that it's safe to exit.
*
* SDL has special behavior on POSIX systems regarding `SIGINT` and
* `SIGTERM` handling, see @ref Platform-Sdl2Application-usage-posix
* for more information.
*/
virtual void exitEvent(ExitEvent& event);
/**
* @brief Tick event
*
* If implemented, this function is called periodically after
* processing all input events and before draw event even though there
* might be no input events and redraw is not requested. Useful e.g.
* for asynchronous task polling. Use @ref setMinimalLoopPeriod()/
* @ref setSwapInterval() to control main loop frequency.
*/
virtual void tickEvent();
/** /**
* @brief Viewport event * @brief Viewport event
* *
@ -947,6 +921,36 @@ class Sdl2Application {
/*@}*/ /*@}*/
/** @{ @name Special events */
/**
* @brief Exit event
*
* If implemented, it allows the application to react to an application
* exit (for example to save its internal state) and suppress it as
* well (for example to show a exit confirmation dialog). The default
* implementation calls @ref ExitEvent::setAccepted() on @p event,
* which tells the application that it's safe to exit.
*
* SDL has special behavior on POSIX systems regarding `SIGINT` and
* `SIGTERM` handling, see @ref Platform-Sdl2Application-usage-posix
* for more information.
*/
virtual void exitEvent(ExitEvent& event);
/**
* @brief Tick event
*
* If implemented, this function is called periodically after
* processing all input events and before draw event even though there
* might be no input events and redraw is not requested. Useful e.g.
* for asynchronous task polling. Use @ref setMinimalLoopPeriod()/
* @ref setSwapInterval() to control main loop frequency.
*/
virtual void tickEvent();
/*@}*/
private: private:
enum class Flag: UnsignedByte { enum class Flag: UnsignedByte {
Redraw = 1 << 0, Redraw = 1 << 0,

Loading…
Cancel
Save