Skip to content

Commit

Permalink
Platform: {Android,Glfw}Application: consistent windowSize() with SDL.
Browse files Browse the repository at this point in the history
Not providing framebufferSize() or dpiScaling() there yet, as that's a
bit involved in both cases. Support will be added, eventually.
  • Loading branch information
mosra committed Aug 22, 2018
1 parent c0125fa commit 25d0bb8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Magnum/Platform/AndroidApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ bool AndroidApplication::tryCreate(const Configuration& configuration, const GLC
return _context->tryCreate();
}

Vector2i AndroidApplication::windowSize() {
Vector2i AndroidApplication::windowSize() const {
return {ANativeWindow_getWidth(_state->window),
ANativeWindow_getHeight(_state->window)};
}
Expand Down
4 changes: 3 additions & 1 deletion src/Magnum/Platform/AndroidApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,15 @@ class AndroidApplication {

/** @{ @name Screen handling */

public:
/**
* @brief Window size
*
* Window size to which all input event coordinates can be related.
*/
Vector2i windowSize();
Vector2i windowSize() const;

protected:
/**
* @brief Swap buffers
*
Expand Down
2 changes: 1 addition & 1 deletion src/Magnum/Platform/GlfwApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ GlfwApplication::~GlfwApplication() {
glfwTerminate();
}

Vector2i GlfwApplication::windowSize() {
Vector2i GlfwApplication::windowSize() const {
Vector2i size;
glfwGetWindowSize(_window, &size.x(), &size.y());
return size;
Expand Down
6 changes: 3 additions & 3 deletions src/Magnum/Platform/GlfwApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,17 +330,17 @@ class GlfwApplication {

/** @{ @name Screen handling */

#ifndef CORRADE_TARGET_EMSCRIPTEN
public:
/**
* @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();
#endif
Vector2i windowSize() const;

protected:
/**
* @brief Swap buffers
*
Expand Down

0 comments on commit 25d0bb8

Please sign in to comment.