|
evan 2026.1.4
Evan
|
OpenXR platform implementation. More...
#include <headers/evan/openxr/IXrPlatform.hpp>


Public Member Functions | |
| virtual | ~IXrPlatform ()=default |
| Virtual destructor. | |
| virtual std::vector< std::string > | getRequiredInstanceExtensions () const override=0 |
| Get the required instance extensions for the OpenXR platform. | |
| 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. | |
| virtual const XrBaseInStructure * | getInstanceCreateInfo () const =0 |
| Retrieves the Android-specific instance creation information. | |
| 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. | |
Protected Member Functions | |
| void | processSessionStateChangedEvent (const XrEventDataSessionStateChanged &eventData, XrDeviceBackend &xrDeviceBackend) |
| Process an OpenXR session state change event. | |
Protected Member Functions inherited from evan::IPlatform | |
| virtual std::filesystem::path | getDefaultCacheRoot () const =0 |
| Get the platform-specific cache root directory. | |
Protected Attributes | |
| bool | _shouldClose = false |
| OpenXrOptions | _options |
Protected Attributes inherited from evan::IPlatform | |
| Error | _lastError = Error::Ok |
| Sticky error recorded by the platform while polling events. | |
OpenXR platform implementation.
This class provides an implementation of the IPlatform interface for OpenXR. It handles platform-specific functionality related to OpenXR.
Definition at line 26 of file IXrPlatform.hpp.
|
virtualdefault |
Virtual destructor.
Ensures proper cleanup of derived class resources.
|
overridevirtual |
Create a device context for the OpenXR platform.
This function creates and returns a shared pointer to a DeviceContext that is compatible with the OpenXR platform. The created device context should be initialized with the necessary resources and configurations required for rendering and interacting with the OpenXR runtime.
Implements evan::IPlatform.
Definition at line 66 of file IXrPlatform.cpp.
|
overridevirtual |
Create a swapchain context for the OpenXR platform.
This function creates and returns a shared pointer to an ASwapchainContext that is compatible with the OpenXR platform. The created swapchain context should be initialized with the necessary resources and configurations required for rendering to the OpenXR runtime's swapchain.
| deviceContext | A reference to the DeviceContext that may be used for initializing the swapchain context with the appropriate device resources. |
Implements evan::IPlatform.
Definition at line 72 of file IXrPlatform.cpp.
|
pure virtual |
Retrieves the Android-specific instance creation information.
This function returns a pointer to the Android-specific instance creation structure, cast to a generic XrBaseInStructure pointer. This is typically used when creating an OpenXR instance on an Android platform.
Implemented in evan::AndroidXrPlatform, and evan::LinuxXrPlatform.
|
inline |
Retrieves the user-configurable OpenXR options (mutable).
Applications may configure options through the concrete platform before handing it to the engine. Subclasses may also override the defaults in their constructors.
Definition at line 155 of file IXrPlatform.hpp.
|
inline |
Retrieves the user-configurable OpenXR options (read-only).
Definition at line 140 of file IXrPlatform.hpp.
|
overridepure virtual |
Get the required instance extensions for the OpenXR platform.
This function returns a vector of strings representing the required instance extensions for the OpenXR platform. These extensions are necessary for proper functionality and compatibility with the OpenXR runtime on the target platform.
Implements evan::IPlatform.
Implemented in evan::AndroidXrPlatform, and evan::LinuxXrPlatform.
|
overridevirtual |
Poll for OpenXR events and handle them accordingly.
This function polls for events from the OpenXR runtime and processes them. It handles events such as session state changes, input events, and other relevant OpenXR events. The function may update internal state based on the events received, such as setting the shouldClose flag when a session state change indicates that the application should exit.
| deviceBackend | A reference to the ADeviceBackend, which may be used for handling device-specific operations related to the events being processed. |
Implements evan::IPlatform.
Definition at line 23 of file IXrPlatform.cpp.
|
protected |
Process an OpenXR session state change event.
This function handles the XrEventDataSessionStateChanged event, updating the internal state of the XrPlatform based on the new session state. It may set flags such as shouldClose or sessionRunning based on the session state received in the event data.
| eventData | The event data containing information about the session state change. |
| xrDeviceBackend | The OpenXR device backend associated with the event. |
Definition at line 95 of file IXrPlatform.cpp.
|
overridevirtual |
Check if the OpenXR platform should close.
This function checks the internal state of the XrPlatform to determine if it should close. This is typically based on events such as session state changes or user input that indicates the application should exit.
Implements evan::IPlatform.
Definition at line 17 of file IXrPlatform.cpp.
|
protected |
User-configurable OpenXR options applied by the device backend and swapchain context created from this platform.
Definition at line 194 of file IXrPlatform.hpp.
Flag to indicate if the platform should close.
OpenXR specific.
Definition at line 188 of file IXrPlatform.hpp.