evan 2026.1.4
Evan
Loading...
Searching...
No Matches
IXrPlatform.hpp
1/*
2** ETIB PROJECT, 2026
3** evan
4** File description:
5** IXrPlatform
6*/
7
8#pragma once
9
10#include "evan/IPlatform.hpp"
11#include "evan/DeviceContext.hpp"
12#include "evan/openxr/OpenXrOptions.hpp"
13#include "evan/openxr/XrSwapchainContext.hpp"
14
15#include <iostream>
16
17namespace evan
18{
19 class XrDeviceBackend;
26 class IXrPlatform: public IPlatform
27 {
28 public:
34 virtual ~IXrPlatform() = default;
35
47 virtual std::vector<std::string>
48 getRequiredInstanceExtensions() const override = 0;
49
60 bool shouldClose() const override;
61
84 virtual std::vector<std::shared_ptr<utility::event::Event>>
86
99 std::shared_ptr<ADeviceBackend> createDeviceBackend() const override;
100
117 std::shared_ptr<ASwapchainContext> createSwapchainContext(
118 const DeviceContext &deviceContext) const override;
119
132 virtual const XrBaseInStructure *getInstanceCreateInfo() const = 0;
133
141 {
142 return _options;
143 }
144
156 {
157 return _options;
158 }
159
160 protected:
182
188 bool _shouldClose = false;
189
195 };
196} // namespace evan
Abstract base class for Vulkan device backends.
Represents the device context for the engine, managing Vulkan-related resources and operations.
Abstract interface for platform-specific functionality.
Definition IPlatform.hpp:36
OpenXR platform implementation.
void processSessionStateChangedEvent(const XrEventDataSessionStateChanged &eventData, XrDeviceBackend &xrDeviceBackend)
Process an OpenXR session state change event.
virtual const XrBaseInStructure * getInstanceCreateInfo() const =0
Retrieves the Android-specific instance creation information.
bool shouldClose() const override
Check if the OpenXR platform should close.
std::shared_ptr< ASwapchainContext > createSwapchainContext(const DeviceContext &deviceContext) const override
Create a swapchain context for the OpenXR platform.
OpenXrOptions _options
const OpenXrOptions & getOpenXrOptions() const
Retrieves the user-configurable OpenXR options (read-only).
virtual ~IXrPlatform()=default
Virtual destructor.
OpenXrOptions & getOpenXrOptions()
Retrieves the user-configurable OpenXR options (mutable).
virtual std::vector< std::shared_ptr< utility::event::Event > > pollEvents(ADeviceBackend &deviceBackend) override
Poll for OpenXR events and handle them accordingly.
virtual std::vector< std::string > getRequiredInstanceExtensions() const override=0
Get the required instance extensions for the OpenXR platform.
std::shared_ptr< ADeviceBackend > createDeviceBackend() const override
Create a device context for the OpenXR platform.
The XrDeviceBackend class is responsible for managing the OpenXR device backend, including instance c...
User-configurable options for the OpenXR backend.
Small result wrapper used by helpers that must return both a status and a value (e....
Definition Error.hpp:89