diff --git a/include/GLFW/glfw3native.h b/include/GLFW/glfw3native.h index 4d1bf3ee..7fc4ee51 100644 --- a/include/GLFW/glfw3native.h +++ b/include/GLFW/glfw3native.h @@ -660,9 +660,21 @@ GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow* window); #endif #if defined(GLFW_EXPOSE_NATIVE_ANDROID) -/*! @brief Returns the `struct android_app` of the specified window. +/*! @brief Returns the `struct android_app` of the current application. + * + * @return The `struct android_app` of the current, or `NULL` if an + * [error](@ref error_handling) occurred. + * + * @errors Possible errors include @ref GLFW_NOT_INITIALIZED + * + * @thread_safety This function may be called from any thread. Access is not + * synchronized. + * + * @since Added in version 3.5. + * + * @ingroup native */ -GLFWAPI struct android_app* glfwGetAndroidApp(GLFWwindow* window); +GLFWAPI struct android_app* glfwGetAndroidApp(void); #endif #ifdef __cplusplus diff --git a/src/android_platform.h b/src/android_platform.h index b2d79806..8233c401 100644 --- a/src/android_platform.h +++ b/src/android_platform.h @@ -131,4 +131,4 @@ void _glfwGetRequiredInstanceExtensionsAndroid(char** extensions); GLFWbool _glfwGetPhysicalDevicePresentationSupportAndroid(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); VkResult _glfwCreateWindowSurfaceAndroid(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); -GLFWAPI struct android_app* glfwGetAndroidApp(GLFWwindow* handle); +GLFWAPI struct android_app* glfwGetAndroidApp(void); diff --git a/src/android_window.c b/src/android_window.c index 452225da..94df9e25 100644 --- a/src/android_window.c +++ b/src/android_window.c @@ -555,9 +555,8 @@ VkResult _glfwCreateWindowSurfaceAndroid(VkInstance instance, ////// GLFW native API ////// ////////////////////////////////////////////////////////////////////////// -GLFWAPI struct android_app* glfwGetAndroidApp(GLFWwindow* handle) +GLFWAPI struct android_app* glfwGetAndroidApp(void) { - _GLFWwindow* window = (_GLFWwindow*)handle; _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - return window->android; + return _glfw.gstate.app; }