Browse Source

Platform: implement Sdl2Application::windowSize() on Emscripten.

pull/216/head
Vladimír Vondruš 9 years ago
parent
commit
ed7eac0b42
  1. 6
      src/Magnum/Platform/Sdl2Application.cpp
  2. 3
      src/Magnum/Platform/Sdl2Application.h

6
src/Magnum/Platform/Sdl2Application.cpp

@ -268,13 +268,15 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
return true;
}
#ifndef CORRADE_TARGET_EMSCRIPTEN
Vector2i Sdl2Application::windowSize() {
#ifndef CORRADE_TARGET_EMSCRIPTEN
Vector2i size;
SDL_GetWindowSize(_window, &size.x(), &size.y());
return size;
#else
return {_glContext->w, _glContext->h};
#endif
}
#endif
void Sdl2Application::swapBuffers() {
#ifndef CORRADE_TARGET_EMSCRIPTEN

3
src/Magnum/Platform/Sdl2Application.h

@ -458,17 +458,14 @@ class Sdl2Application {
/** @{ @name Screen handling */
#ifndef CORRADE_TARGET_EMSCRIPTEN
/**
* @brief Window size
*
* Window size to which all input event coordinates can be related.
* Note that especially on HiDPI systems the reported window size might
* not be the same as framebuffer size.
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
*/
Vector2i windowSize();
#endif
/**
* @brief Swap buffers

Loading…
Cancel
Save