Browse Source

Platform: fix Emscripten build.

pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
b5017752a3
  1. 2
      src/Magnum/Platform/Sdl2Application.cpp
  2. 18
      src/Magnum/Platform/Sdl2Application.h

2
src/Magnum/Platform/Sdl2Application.cpp

@ -109,8 +109,10 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, configuration.sampleCount() > 1 ? 1 : 0); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, configuration.sampleCount() > 1 ? 1 : 0);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, configuration.sampleCount()); SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, configuration.sampleCount());
#ifndef CORRADE_TARGET_EMSCRIPTEN
/* Context flags */ /* Context flags */
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, int(configuration.flags())); SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, int(configuration.flags()));
#endif
/* Flags: if not hidden, set as shown */ /* Flags: if not hidden, set as shown */
Uint32 windowFlags(configuration.windowFlags()); Uint32 windowFlags(configuration.windowFlags());

18
src/Magnum/Platform/Sdl2Application.h

@ -423,10 +423,13 @@ depth buffer.
*/ */
class Sdl2Application::Configuration { class Sdl2Application::Configuration {
public: public:
#ifndef CORRADE_TARGET_EMSCRIPTEN
/** /**
* @brief Context flag * @brief Context flag
* *
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
* @see @ref Flags @ref setFlags() * @see @ref Flags @ref setFlags()
* @todo re-enable when Emscripten has proper SDL2 support
*/ */
enum class Flag: int { enum class Flag: int {
Debug = SDL_GL_CONTEXT_DEBUG_FLAG, /**< Create debug context */ Debug = SDL_GL_CONTEXT_DEBUG_FLAG, /**< Create debug context */
@ -438,6 +441,7 @@ class Sdl2Application::Configuration {
/** /**
* @brief Context flags * @brief Context flags
* *
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
* @see @ref setFlags() * @see @ref setFlags()
*/ */
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
@ -446,6 +450,7 @@ class Sdl2Application::Configuration {
#else #else
typedef Containers::EnumSet<Flag, int> Flags; typedef Containers::EnumSet<Flag, int> Flags;
#endif #endif
#endif
/** /**
* @brief Window flag * @brief Window flag
@ -532,7 +537,12 @@ class Sdl2Application::Configuration {
return *this; return *this;
} }
/** @brief Context flags */ #ifndef CORRADE_TARGET_EMSCRIPTEN
/**
* @brief Context flags
*
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
*/
Flags flags() const { return _flags; } Flags flags() const { return _flags; }
/** /**
@ -540,13 +550,13 @@ class Sdl2Application::Configuration {
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is no flag. * Default is no flag.
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
*/ */
Configuration& setFlags(Flags flags) { Configuration& setFlags(Flags flags) {
_flags = flags; _flags = flags;
return *this; return *this;
} }
#ifndef CORRADE_TARGET_EMSCRIPTEN
/** /**
* @brief Context version * @brief Context version
* *
@ -598,11 +608,13 @@ class Sdl2Application::Configuration {
Int _sampleCount; Int _sampleCount;
#ifndef CORRADE_TARGET_EMSCRIPTEN #ifndef CORRADE_TARGET_EMSCRIPTEN
Version _version; Version _version;
#endif
Flags _flags; Flags _flags;
#endif
}; };
#ifndef CORRADE_TARGET_EMSCRIPTEN
CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::Flags) CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::Flags)
#endif
CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::WindowFlags) CORRADE_ENUMSET_OPERATORS(Sdl2Application::Configuration::WindowFlags)
/** /**

Loading…
Cancel
Save