VTK  9.3.1
vtkOpenXRManagerD3DGraphics.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
11 #ifndef vtkOpenXRManagerD3DGraphics_h
12 #define vtkOpenXRManagerD3DGraphics_h
13 
15 #include "vtkRenderingOpenXRRemotingModule.h" // For export macro
16 
17 #include "vtkOpenXR.h" // For extension name
18 
19 #include <memory> // For shared_ptr
20 #include <vector> // For std::vector
21 
22 struct XrGraphicsBindingD3D11KHR;
23 struct XrSwapchainImageD3D11KHR;
24 
25 VTK_ABI_NAMESPACE_BEGIN
26 class VTKRENDERINGOPENXRREMOTING_EXPORT vtkOpenXRManagerD3DGraphics
28 {
29 public:
32 
36  void SetNumberOfSwapchains(uint32_t viewCount) override;
37 
39 
43  void GetColorSwapchainImage(uint32_t scIndex, uint32_t imgIndex, void* texture) override;
44  void GetDepthSwapchainImage(uint32_t scIndex, uint32_t imgIndex, void* texture) override;
46 
48 
51  void EnumerateColorSwapchainImages(XrSwapchain swapchain, uint32_t scIndex) override;
52  void EnumerateDepthSwapchainImages(XrSwapchain swapchain, uint32_t scIndex) override;
54 
56 
60  const std::vector<int64_t>& GetSupportedColorFormats() override;
61  const std::vector<int64_t>& GetSupportedDepthFormats() override;
63 
67  bool CreateGraphicsBinding(vtkOpenGLRenderWindow* helperWindow) override;
68 
72  const void* GetGraphicsBinding() override { return this->GraphicsBinding.get(); };
73 
78  bool CheckGraphicsRequirements(XrInstance instance, XrSystemId id) override;
79 
83  const char* GetBackendExtensionName() override;
84 
85 protected:
87  ~vtkOpenXRManagerD3DGraphics() override;
88 
93  {
94  std::vector<XrSwapchainImageD3D11KHR> Images;
95  };
96 
100  void EnumerateSwapchainImages(XrSwapchain swapchain, SwapchainImagesD3D& swapchainImages);
101 
102  std::shared_ptr<XrGraphicsBindingD3D11KHR> GraphicsBinding;
103 
104 private:
106  void operator=(const vtkOpenXRManagerD3DGraphics&) = delete;
107 
108  class PIMPL;
109  PIMPL* Private;
110 };
111 
112 VTK_ABI_NAMESPACE_END
113 #endif
OpenGL rendering window.
virtual void GetColorSwapchainImage(uint32_t eyeIndex, uint32_t imgIndex, void *texture)=0
Fill texture with the swapchain image for the specified eye.
OpenXR manager D3D graphics implementation.
D3D structure to store swapchain images.
std::vector< XrSwapchainImageD3D11KHR > Images
virtual void GetDepthSwapchainImage(uint32_t eyeIndex, uint32_t imgIndex, void *texture)=0
Fill texture with the swapchain image for the specified eye.
virtual void EnumerateDepthSwapchainImages(XrSwapchain swapchain, uint32_t eyeIndex)=0
Acquire swapchain images using xrEnumerateSwapchainImages and store them at the specified eye index...
std::shared_ptr< XrGraphicsBindingD3D11KHR > GraphicsBinding
virtual const std::vector< int64_t > & GetSupportedDepthFormats()=0
Return the list of pixel formats supported by VTK.
virtual const char * GetBackendExtensionName()=0
Return the extension name to enable a specific rendering backend.
OpenXR manager graphics implementation.
virtual const std::vector< int64_t > & GetSupportedColorFormats()=0
Return the list of pixel formats supported by VTK.
virtual bool CheckGraphicsRequirements(XrInstance instance, XrSystemId id)=0
OpenXR requires checking graphics requirements before creating a session.
virtual void SetNumberOfSwapchains(uint32_t viewCount)=0
Resize the internal vectors storing the color and depth swapchains.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
const void * GetGraphicsBinding() override
Return pointer to the XrGraphicsBindingD3D11 structure required to create the OpenXR session...
virtual bool CreateGraphicsBinding(vtkOpenGLRenderWindow *helperWindow)=0
Create the graphics binding and store it in GraphicsBindings ptr.
Defines the OpenXR types and extensions common to all platforms.
virtual void EnumerateColorSwapchainImages(XrSwapchain swapchain, uint32_t eyeIndex)=0
Acquire swapchain images using xrEnumerateSwapchainImages and store them at the specified eye index...