Browse Source

Platform: added Sdl2Application::windowSize().

pull/183/head^2
Vladimír Vondruš 10 years ago
parent
commit
fcb7277524
  1. 6
      src/Magnum/Platform/Sdl2Application.cpp
  2. 9
      src/Magnum/Platform/Sdl2Application.h

6
src/Magnum/Platform/Sdl2Application.cpp

@ -273,6 +273,12 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
return true; return true;
} }
Vector2i Sdl2Application::windowSize() {
Vector2i size;
SDL_GetWindowSize(_window, &size.x(), &size.y());
return size;
}
void Sdl2Application::swapBuffers() { void Sdl2Application::swapBuffers() {
#ifndef CORRADE_TARGET_EMSCRIPTEN #ifndef CORRADE_TARGET_EMSCRIPTEN
SDL_GL_SwapWindow(_window); SDL_GL_SwapWindow(_window);

9
src/Magnum/Platform/Sdl2Application.h

@ -421,6 +421,15 @@ class Sdl2Application {
/** @{ @name Screen handling */ /** @{ @name Screen handling */
/**
* @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.
*/
Vector2i windowSize();
/** /**
* @brief Swap buffers * @brief Swap buffers
* *

Loading…
Cancel
Save