2#include <glm/ext/matrix_float4x4.hpp>
3#include <openxr/openxr.h>
6#include <vulkan/vulkan_core.h>
The application context is the core class which stores the basic openxr and vulkan objects.
VkSampler getHiZSampler() const
VkExtent2D getEyeResolution(size_t eyeIndex) const
Gets eye resolution in x and y for a specified eye index. 0 is left.
std::vector< XrView > eyePoses
void beginXrSession() const
glm::mat4 getEyeViewMatrix(size_t eyeIndex) const
Returns the view matrix of the specified eye.
std::vector< RenderTarget > swapchainRenderTargets
The swapchain render targets. The images get rendered onto those render targets.
std::unique_ptr< NamedThreadPool > xrWaitThreadPool_
glm::mat4 getViewProjectionMatrix(size_t eyeIndex) const
Gets you a matrix of the multiplied view and projection matrix.
VkImageView getColorBufferView() const
XrSession getSession() const
Gets the active xr session.
XrSpace xrReferenceSpace
The xr reference space.
std::vector< XrCompositionLayerProjectionView > eyeRenderInfos
void endXrSession() const
ends the xr session and thus terminating the xr window on the headset
void setPlayerPosition(const glm::vec3 &position)
Sets the player world position offset. This offset is applied to all view matrices.
XrReferenceSpaceType xrReferenceSpaceType
Type of the xr reference space, if it is room scale or just sitting vr.
void endXrFrameNoRender()
std::vector< XrViewConfigurationView > eyeImageInfos
XrSessionState xrSessionState
void requestExitSession()
Requests the XR runtime to exit the session gracefully. This should be called when the application wa...
VkImageView getDepthBufferView() const
VkImage getColorBufferImage() const
void updateViewMatrix()
Updates the eye matrix for the headset.
XrSession xrSession
The xr session.
std::vector< RenderTarget > getSwapchainRenderTargets()
Headset(const ApplicationContext *context=nullptr)
WaitFrameResult waitForXrFrame(Renderer *renderer)
First part of frame setup: calls xrWaitFrame. Can be called before previous xrEndFrame completes....
glm::mat4 getEyeProjectionMatrix(size_t eyeIndex) const
Gets the projection matrix for an eye.
BeginFrameResult beginXrFrame(uint32_t &swapchainImageIndex, Renderer *renderer)
Legacy function that combines waitForXrFrame and beginXrFrameAfterWait. Kept for compatibility but pr...
bool getIsExitRequested() const
Gets whether the headset has requested for the application to stop.
XrSpace getReferenceSpace() const
Gets reference space for the xr headset.
void createHiZSampler(VkDevice device)
BeginFrameResult beginXrFrameAfterWait(uint32_t &swapchainImageIndex)
Second part of frame setup: calls xrBeginFrame, acquires swapchain image. MUST be called after previo...
const RenderTarget * getRenderTarget(size_t swapchainImageIndex) const
uint32_t getEyeCount() const
Gets eye count.
VkImage getSwapchainImage(size_t swapchainImageIndex) const
Gets the swapchain image for the given index.
XrFrameState xrFrameState
const ApplicationContext * context
glm::vec3 playerPosition_
XrFrameState getXrFrameState() const
gets the current state of the frame
VkImage getDepthBufferImage() const
glm::vec3 getPlayerPosition() const
Gets the current player world position.
VkRenderPass getRenderPass() const
Gets render pass.
VkRenderPass vkRenderPass
The vulkan render pass.
The renderer is the main class for rendering. It owns all data which is used any time in any frame....
Tracy-named thread pool using BS_tracy::tracy_thread_pool.
Log category system implementation.
glm::mat4 eyeProjectionMatrix
VkDeviceMemory deviceMemory
Result from waitForXrFrame indicating what the main loop should do.
bool shouldCallBeginFrame
A render target which contains all resources to access the rendered image.
VkImageLayout imageLayout
void cleanup(const ApplicationContext *context)
VkFramebuffer framebuffer