Browse Source

Platform: ignore Sdl2Application title in Emscripten.

pull/38/head
Vladimír Vondruš 13 years ago
parent
commit
fc1a486f00
  1. 7
      src/Platform/Sdl2Application.cpp
  2. 17
      src/Platform/Sdl2Application.h

7
src/Platform/Sdl2Application.cpp

@ -251,7 +251,12 @@ void Sdl2Application::mousePressEvent(MouseEvent&) {}
void Sdl2Application::mouseReleaseEvent(MouseEvent&) {}
void Sdl2Application::mouseMoveEvent(MouseMoveEvent&) {}
Sdl2Application::Configuration::Configuration(): _title("Magnum SDL2 Application"), _size(800, 600), _flags(Flag::Resizable), _sampleCount(0) {}
Sdl2Application::Configuration::Configuration():
#ifndef CORRADE_TARGET_EMSCRIPTEN
_title("Magnum SDL2 Application"),
#endif
_size(800, 600), _flags(Flag::Resizable), _sampleCount(0) {}
Sdl2Application::Configuration::~Configuration() = default;
Sdl2Application::InputEvent::Modifiers Sdl2Application::MouseEvent::modifiers() {

17
src/Platform/Sdl2Application.h

@ -393,19 +393,32 @@ class Sdl2Application::Configuration {
/*implicit*/ Configuration();
~Configuration();
/** @brief Window title */
#ifndef CORRADE_TARGET_EMSCRIPTEN
/**
* @brief Window title
*
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN.
*/
std::string title() const { return _title; }
#endif
/**
* @brief Set window title
* @return Reference to self (for method chaining)
*
* Default is `"Magnum SDL2 Application"`.
* @note In @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" this function
* does nothing and is included only for compatibility. You need
* to set the title separately in application's HTML markup.
*/
#ifndef CORRADE_TARGET_EMSCRIPTEN
Configuration& setTitle(std::string title) {
_title = std::move(title);
return *this;
}
#else
template<class T> Configuration& setTitle(const T&) { return *this; }
#endif
/** @brief Window size */
Vector2i size() const { return _size; }
@ -451,7 +464,9 @@ class Sdl2Application::Configuration {
}
private:
#ifndef CORRADE_TARGET_EMSCRIPTEN
std::string _title;
#endif
Vector2i _size;
Flags _flags;
Int _sampleCount;

Loading…
Cancel
Save