Browse Source

Platform: no point in having SDL2 window title on iOS.

pull/136/head
Vladimír Vondruš 10 years ago
parent
commit
e70cb8bfdc
  1. 9
      src/Magnum/Platform/Sdl2Application.cpp
  2. 16
      src/Magnum/Platform/Sdl2Application.h

9
src/Magnum/Platform/Sdl2Application.cpp

@ -164,7 +164,12 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
}
/* Create window */
if(!(_window = SDL_CreateWindow(configuration.title().data(),
if(!(_window = SDL_CreateWindow(
#ifndef CORRADE_TARGET_IOS
configuration.title().data(),
#else
nullptr,
#endif
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
configuration.size().x(), configuration.size().y(),
SDL_WINDOW_OPENGL|windowFlags)))
@ -431,7 +436,7 @@ void Sdl2Application::mouseReleaseEvent(MouseEvent&) {}
void Sdl2Application::mouseMoveEvent(MouseMoveEvent&) {}
Sdl2Application::Configuration::Configuration():
#ifndef CORRADE_TARGET_EMSCRIPTEN
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS)
_title("Magnum SDL2 Application"),
#endif
_size(800, 600), _windowFlags{}, _sampleCount(0)

16
src/Magnum/Platform/Sdl2Application.h

@ -617,11 +617,12 @@ class Sdl2Application::Configuration {
/*implicit*/ Configuration();
~Configuration();
#ifndef CORRADE_TARGET_EMSCRIPTEN
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS)
/**
* @brief Window title
*
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten"
* and @ref CORRADE_TARGET_IOS "iOS".
*/
std::string title() const { return _title; }
#endif
@ -631,11 +632,12 @@ class Sdl2Application::Configuration {
* @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.
* @note In @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" and
* @ref CORRADE_TARGET_IOS "iOS" this function does nothing and is
* included only for compatibility. You need to set the title
* separately in platform-specific configuration file.
*/
#ifndef CORRADE_TARGET_EMSCRIPTEN
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS)
Configuration& setTitle(std::string title) {
_title = std::move(title);
return *this;
@ -756,7 +758,7 @@ class Sdl2Application::Configuration {
#endif
private:
#ifndef CORRADE_TARGET_EMSCRIPTEN
#if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS)
std::string _title;
#endif
Vector2i _size;

Loading…
Cancel
Save