|
evan 2026.1.4
Evan
|
The AndroidXrPlatform class provides platform-specific implementations for OpenXR on Android devices. More...
#include <headers/evan/openxr/platform/AndroidXrPlatform.hpp>


Classes | |
| struct | AndroidAppState |
| Struct to track the current state of the Android application. This struct is used to manage the lifecycle of the Android application and ensure that the OpenXR session responds appropriately to changes in the application state, such as when the app is resumed, paused, or stopped. More... | |
| struct | AndroidPlatformData |
| Struct to hold Android-specific platform data for OpenXR initialization. More... | |
Public Member Functions | |
| AndroidXrPlatform (const AndroidPlatformData &platformData) | |
| Constructs an AndroidXrPlatform instance with the specified Android platform data. | |
| ~AndroidXrPlatform () override=default | |
| Destructor for AndroidXrPlatform. | |
| std::vector< std::string > | getRequiredInstanceExtensions () const override |
| Retrieves the list of required OpenXR instance extensions for Android platform. | |
| const XrBaseInStructure * | getInstanceCreateInfo () const override |
| Retrieves the Android-specific XR instance creation information. | |
Public Member Functions inherited from evan::IXrPlatform | |
| virtual | ~IXrPlatform ()=default |
| Virtual destructor. | |
| bool | shouldClose () const override |
| Check if the OpenXR platform should close. | |
| virtual std::vector< std::shared_ptr< utility::event::Event > > | pollEvents (ADeviceBackend &deviceBackend) override |
| Poll for OpenXR events and handle them accordingly. | |
| std::shared_ptr< ADeviceBackend > | createDeviceBackend () const override |
| Create a device context for the OpenXR platform. | |
| std::shared_ptr< ASwapchainContext > | createSwapchainContext (const DeviceContext &deviceContext) const override |
| Create a swapchain context for the OpenXR platform. | |
| const OpenXrOptions & | getOpenXrOptions () const |
| Retrieves the user-configurable OpenXR options (read-only). | |
| OpenXrOptions & | getOpenXrOptions () |
| Retrieves the user-configurable OpenXR options (mutable). | |
Public Member Functions inherited from evan::IPlatform | |
| virtual | ~IPlatform ()=default |
| Virtual destructor. | |
| virtual VkInstanceCreateFlags | getInstanceCreateFlags () const |
| Get platform-specific Vulkan instance creation flags. | |
| virtual std::vector< std::string > | getRequiredDeviceExtensions () const |
| Get platform-specific required Vulkan device extensions. | |
| virtual std::filesystem::path | getPipelineCachePath () const |
| Get the path where the Vulkan pipeline cache is persisted. | |
| Error | getLastError () const |
| Get the last error recorded by the platform. | |
Public Attributes | |
| AndroidAppState | _appState = {} |
| Tracks the current state of the Android application. | |
Protected Member Functions | |
| std::filesystem::path | getDefaultCacheRoot () const override |
| Get the cache root directory of the Android application. | |
Protected Member Functions inherited from evan::IXrPlatform | |
| void | processSessionStateChangedEvent (const XrEventDataSessionStateChanged &eventData, XrDeviceBackend &xrDeviceBackend) |
| Process an OpenXR session state change event. | |
Additional Inherited Members | |
Protected Attributes inherited from evan::IXrPlatform | |
| bool | _shouldClose = false |
| OpenXrOptions | _options |
Protected Attributes inherited from evan::IPlatform | |
| Error | _lastError = Error::Ok |
| Sticky error recorded by the platform while polling events. | |
The AndroidXrPlatform class provides platform-specific implementations for OpenXR on Android devices.
This class implements the IXrPlatform interface to provide the necessary configurations and extensions required for creating an OpenXR instance on Android. It handles the retrieval of required instance extensions and provides the appropriate instance creation information for Android platforms.
Definition at line 26 of file AndroidXrPlatform.hpp.
| evan::AndroidXrPlatform::AndroidXrPlatform | ( | const AndroidPlatformData & | platformData | ) |
Constructs an AndroidXrPlatform instance with the specified Android platform data.
Initializes the AndroidXrPlatform with the provided Android-specific data, which is necessary for creating an OpenXR instance on Android platforms.
| platformData | The Android-specific platform data required for OpenXR initialization on Android devices. |
Definition at line 132 of file AndroidXrPlatform.cpp.
|
overridedefault |
Destructor for AndroidXrPlatform.
Ensures proper cleanup of resources used by the AndroidXrPlatform.
|
overrideprotectedvirtual |
Get the cache root directory of the Android application.
Android applications may only write inside the directories the system gave them, so this method asks the Java activity for its cache directory (Context.getCacheDir()) through the Java VM stored in the platform data. This is where the Vulkan pipeline cache blob is persisted, so compiled pipelines are reused across launches.
Implements evan::IPlatform.
Definition at line 192 of file AndroidXrPlatform.cpp.
|
overridevirtual |
Retrieves the Android-specific XR instance creation information.
This function returns a pointer to the platform-specific instance creation information structure used for OpenXR initialization on Android platforms.
Implements evan::IXrPlatform.
Definition at line 178 of file AndroidXrPlatform.cpp.
|
overridevirtual |
Retrieves the list of required OpenXR instance extensions for Android platform.
This function returns a vector of extension name strings that must be enabled when creating an OpenXR instance on Android. The extensions include Vulkan2 support and Android-specific instance creation extensions.
Implements evan::IXrPlatform.
Definition at line 167 of file AndroidXrPlatform.cpp.
| AndroidAppState evan::AndroidXrPlatform::_appState = {} |
Tracks the current state of the Android application.
This variable is used to keep track of the current state of the Android application, such as whether it is in the foreground, paused, or stopped. It can be used to manage OpenXR session state and ensure that the application responds appropriately to changes in its lifecycle on Android devices.
Definition at line 175 of file AndroidXrPlatform.hpp.