Skyscraper 2.0
OgreOpenXRSwapchain.h
Go to the documentation of this file.
1/*
2 Skyscraper 2.0 - OpenXR Swapchain
3 Portions Copyright (C)2024 Ryan Thoryk
4 MIT license - see LICENSE file
5 https://www.skyscrapersim.net
6 https://sourceforge.net/projects/skyscraper/
7 Contact - ryan@skyscrapersim.net
8*/
9
10/*
11 Original work produced by Glastonbridge Software Limited. This code is provided under the MIT license.
12 https://github.com/glastonbridge/OgreOpenXRRenderWindow
13*/
14
15#pragma once
16
17#include "OgreOpenXRConfig.h"
18#include <openxr/openxr.h>
19#include <openxr/openxr_platform.h>
20#include <utility>
21#include "XrUtility/XrHandle.h"
22#include <d3d11.h>
23#include <vector>
24
25
28 DXGI_FORMAT Format{ DXGI_FORMAT_UNKNOWN };
29 uint32_t Width{ 0 };
30 uint32_t Height{ 0 };
31 uint32_t ArraySize{ 0 };
32 std::vector<XrSwapchainImageD3D11KHR> Images;
33};
34
35namespace Ogre {
36 class OpenXRState;
37 class OpenXRViewProjection;
38
43 public:
45
46 void Initialize(OpenXRState* state, OpenXRViewProjection* viewProjection);
47
48 void AcquireImages();
49 void ReleaseImages();
50 bool hasImages() {return isAcquired;}
51
52 XrRect2Di getImageRect();
53 ID3D11Texture2D* getSurface(size_t index) const;
54
55 XrSwapchain getColorSwapchain();
56 XrSwapchain getDepthSwapchain();
57 ID3D11Texture2D* getColorTexture();
58 ID3D11Texture2D* getDepthTexture();
61 private:
67 };
68}
DXGI_FORMAT ColorSwapchainPixelFormat
void Initialize(OpenXRState *state, OpenXRViewProjection *viewProjection)
DXGI_FORMAT DepthSwapchainPixelFormat
ID3D11Texture2D * getSurface(size_t index) const
ID3D11Texture2D * getDepthTexture()
ID3D11Texture2D * getColorTexture()
std::vector< XrSwapchainImageD3D11KHR > Images
xr::SwapchainHandle Handle