Browse Source

Platform: {Android,Glfw}Application: consistent windowSize() with SDL.

Not providing framebufferSize() or dpiScaling() there yet, as that's a
bit involved in both cases. Support will be added, eventually.
pull/272/head
Vladimír Vondruš 8 years ago
parent
commit
25d0bb8768
  1. 2
      src/Magnum/Platform/AndroidApplication.cpp
  2. 4
      src/Magnum/Platform/AndroidApplication.h
  3. 2
      src/Magnum/Platform/GlfwApplication.cpp
  4. 6
      src/Magnum/Platform/GlfwApplication.h

2
src/Magnum/Platform/AndroidApplication.cpp

@ -165,7 +165,7 @@ bool AndroidApplication::tryCreate(const Configuration& configuration, const GLC
return _context->tryCreate(); return _context->tryCreate();
} }
Vector2i AndroidApplication::windowSize() { Vector2i AndroidApplication::windowSize() const {
return {ANativeWindow_getWidth(_state->window), return {ANativeWindow_getWidth(_state->window),
ANativeWindow_getHeight(_state->window)}; ANativeWindow_getHeight(_state->window)};
} }

4
src/Magnum/Platform/AndroidApplication.h

@ -300,13 +300,15 @@ class AndroidApplication {
/** @{ @name Screen handling */ /** @{ @name Screen handling */
public:
/** /**
* @brief Window size * @brief Window size
* *
* Window size to which all input event coordinates can be related. * Window size to which all input event coordinates can be related.
*/ */
Vector2i windowSize(); Vector2i windowSize() const;
protected:
/** /**
* @brief Swap buffers * @brief Swap buffers
* *

2
src/Magnum/Platform/GlfwApplication.cpp

@ -424,7 +424,7 @@ GlfwApplication::~GlfwApplication() {
glfwTerminate(); glfwTerminate();
} }
Vector2i GlfwApplication::windowSize() { Vector2i GlfwApplication::windowSize() const {
Vector2i size; Vector2i size;
glfwGetWindowSize(_window, &size.x(), &size.y()); glfwGetWindowSize(_window, &size.x(), &size.y());
return size; return size;

6
src/Magnum/Platform/GlfwApplication.h

@ -330,7 +330,7 @@ class GlfwApplication {
/** @{ @name Screen handling */ /** @{ @name Screen handling */
#ifndef CORRADE_TARGET_EMSCRIPTEN public:
/** /**
* @brief Window size * @brief Window size
* *
@ -338,9 +338,9 @@ class GlfwApplication {
* Note that especially on HiDPI systems the reported window size might * Note that especially on HiDPI systems the reported window size might
* not be the same as framebuffer size. * not be the same as framebuffer size.
*/ */
Vector2i windowSize(); Vector2i windowSize() const;
#endif
protected:
/** /**
* @brief Swap buffers * @brief Swap buffers
* *

Loading…
Cancel
Save