diff --git a/doc/changelog.dox b/doc/changelog.dox index a8b746abf..d22ede14f 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -62,6 +62,8 @@ See also: @subsubsection changelog-latest-new-platform Platform libraries - 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 diff --git a/src/Magnum/Platform/AndroidApplication.cpp b/src/Magnum/Platform/AndroidApplication.cpp index fe07f63f5..4f65adfe6 100644 --- a/src/Magnum/Platform/AndroidApplication.cpp +++ b/src/Magnum/Platform/AndroidApplication.cpp @@ -78,6 +78,10 @@ AndroidApplication::~AndroidApplication() { eglTerminate(_display); } +ANativeActivity* AndroidApplication::nativeActivity() { + return _state->activity; +} + void AndroidApplication::createContext() { createContext({}); } void AndroidApplication::createContext(const Configuration& configuration) { diff --git a/src/Magnum/Platform/AndroidApplication.h b/src/Magnum/Platform/AndroidApplication.h index b2681b6c5..dbfa2c2a8 100644 --- a/src/Magnum/Platform/AndroidApplication.h +++ b/src/Magnum/Platform/AndroidApplication.h @@ -46,6 +46,7 @@ #undef None struct android_app; +struct ANativeActivity; namespace Magnum { namespace Platform { @@ -191,6 +192,13 @@ class AndroidApplication { /** @brief Moving is not allowed */ AndroidApplication& operator=(AndroidApplication&&) = delete; + /** + * @brief Underlying native activity handle + * + * Use in case you need to call NDK functionality directly. + */ + ANativeActivity* nativeActivity(); + protected: /** @copydoc Sdl2Application::createContext() */ #ifdef DOXYGEN_GENERATING_OUTPUT