Browse Source

Platform: added AndroidApplication::nativeActivity().

pull/205/head
Vladimír Vondruš 8 years ago
parent
commit
1bb5b89505
  1. 2
      doc/changelog.dox
  2. 4
      src/Magnum/Platform/AndroidApplication.cpp
  3. 8
      src/Magnum/Platform/AndroidApplication.h

2
doc/changelog.dox

@ -62,6 +62,8 @@ See also:
@subsubsection changelog-latest-new-platform Platform libraries @subsubsection changelog-latest-new-platform Platform libraries
- Added @ref Platform::AndroidApplication::windowSize() - Added @ref Platform::AndroidApplication::windowSize()
- Added @ref Platform::AndroidApplication::nativeActivity() to access
underlying `ANativeActivity` structure for calling various Android APIs
@subsubsection changelog-latest-new-primitives Primitives library @subsubsection changelog-latest-new-primitives Primitives library

4
src/Magnum/Platform/AndroidApplication.cpp

@ -78,6 +78,10 @@ AndroidApplication::~AndroidApplication() {
eglTerminate(_display); eglTerminate(_display);
} }
ANativeActivity* AndroidApplication::nativeActivity() {
return _state->activity;
}
void AndroidApplication::createContext() { createContext({}); } void AndroidApplication::createContext() { createContext({}); }
void AndroidApplication::createContext(const Configuration& configuration) { void AndroidApplication::createContext(const Configuration& configuration) {

8
src/Magnum/Platform/AndroidApplication.h

@ -46,6 +46,7 @@
#undef None #undef None
struct android_app; struct android_app;
struct ANativeActivity;
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
@ -191,6 +192,13 @@ class AndroidApplication {
/** @brief Moving is not allowed */ /** @brief Moving is not allowed */
AndroidApplication& operator=(AndroidApplication&&) = delete; AndroidApplication& operator=(AndroidApplication&&) = delete;
/**
* @brief Underlying native activity handle
*
* Use in case you need to call NDK functionality directly.
*/
ANativeActivity* nativeActivity();
protected: protected:
/** @copydoc Sdl2Application::createContext() */ /** @copydoc Sdl2Application::createContext() */
#ifdef DOXYGEN_GENERATING_OUTPUT #ifdef DOXYGEN_GENERATING_OUTPUT

Loading…
Cancel
Save