Browse Source

Platform: add missing EmscriptenApp::Config::{add,clear}WindowFlags().

All other apps have it.
euler-xxx
Vladimír Vondruš 5 years ago
parent
commit
67eed6d546
  1. 3
      doc/changelog.dox
  2. 33
      src/Magnum/Platform/EmscriptenApplication.h

3
doc/changelog.dox

@ -226,6 +226,9 @@ See also:
other context classes other context classes
- Undefining even more noise from `Xlib.h` (see - Undefining even more noise from `Xlib.h` (see
[mosra/magnum#498](https://github.com/mosra/magnum/pull/498)) [mosra/magnum#498](https://github.com/mosra/magnum/pull/498))
- Added @ref Platform::EmscriptenApplication::Configuration::addWindowFlags()
and @ref Platform::EmscriptenApplication::Configuration::clearWindowFlags()
for consistency with other application implementations
@subsubsection changelog-latest-changes-shaders Shaders library @subsubsection changelog-latest-changes-shaders Shaders library

33
src/Magnum/Platform/EmscriptenApplication.h

@ -1232,12 +1232,45 @@ class EmscriptenApplication::Configuration {
/** /**
* @brief Set window flags * @brief Set window flags
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
*
* Default are none. To avoid clearing default flags by accident,
* prefer to use @ref addWindowFlags() and @ref clearWindowFlags()
* instead.
*/ */
Configuration& setWindowFlags(WindowFlags windowFlags) { Configuration& setWindowFlags(WindowFlags windowFlags) {
_windowFlags = windowFlags; _windowFlags = windowFlags;
return *this; return *this;
} }
/**
* @brief Add window flags
* @return Reference to self (for method chaining)
* @m_since_latest
*
* Unlike @ref setWindowFlags(), ORs the flags with existing instead of
* replacing them. Useful for preserving the defaults.
* @see @ref clearWindowFlags()
*/
Configuration& addWindowFlags(WindowFlags flags) {
_windowFlags |= flags;
return *this;
}
/**
* @brief Clear window flags
* @return Reference to self (for method chaining)
* @m_since_latest
*
* Unlike @ref setWindowFlags(), ANDs the inverse of @p flags with
* existing instead of replacing them. Useful for removing default
* flags.
* @see @ref addWindowFlags()
*/
Configuration& clearWindowFlags(WindowFlags flags) {
_windowFlags &= ~flags;
return *this;
}
private: private:
Vector2i _size; Vector2i _size;
Vector2 _dpiScaling; Vector2 _dpiScaling;

Loading…
Cancel
Save