VTK  9.3.0
vtkOpenXRManagerGraphics.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
16 #ifndef vtkOpenXRManagerGraphics_h
17 #define vtkOpenXRManagerGraphics_h
18 
19 #include "vtkObject.h"
20 #include "vtkRenderingOpenXRModule.h" // For export macro
21 
22 #include "vtkOpenXR.h" // For OpenXR types
23 #include <vector> // For std::vector
24 VTK_ABI_NAMESPACE_BEGIN
25 
27 
28 class VTKRENDERINGOPENXR_EXPORT vtkOpenXRManagerGraphics : public vtkObject
29 {
30 public:
32 
36  virtual void SetNumberOfSwapchains(uint32_t viewCount) = 0;
37 
39 
43  virtual void GetColorSwapchainImage(uint32_t eyeIndex, uint32_t imgIndex, void* texture) = 0;
44  virtual void GetDepthSwapchainImage(uint32_t eyeIndex, uint32_t imgIndex, void* texture) = 0;
46 
48 
52  virtual void EnumerateColorSwapchainImages(XrSwapchain swapchain, uint32_t eyeIndex) = 0;
53  virtual void EnumerateDepthSwapchainImages(XrSwapchain swapchain, uint32_t eyeIndex) = 0;
55 
59  uint32_t GetChainLength(XrSwapchain swapchain);
60 
62 
66  virtual const std::vector<int64_t>& GetSupportedColorFormats() = 0;
67  virtual const std::vector<int64_t>& GetSupportedDepthFormats() = 0;
69 
76  virtual bool CreateGraphicsBinding(vtkOpenGLRenderWindow* helperWindow) = 0;
77 
82  virtual const void* GetGraphicsBinding() = 0;
83 
89  virtual bool CheckGraphicsRequirements(XrInstance instance, XrSystemId id) = 0;
90 
94  virtual const char* GetBackendExtensionName() = 0;
95 
96 protected:
98  ~vtkOpenXRManagerGraphics() override = default;
99 
100 private:
102  void operator=(const vtkOpenXRManagerGraphics&) = delete;
103 };
104 
105 VTK_ABI_NAMESPACE_END
106 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:52
OpenGL rendering window.
OpenXR manager graphics implementation.
uint32_t GetChainLength(XrSwapchain swapchain)
Acquire the number of images in the specified swapchain.
virtual void SetNumberOfSwapchains(uint32_t viewCount)=0
Resize the internal vectors storing the color and depth swapchains.
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 const std::vector< int64_t > & GetSupportedDepthFormats()=0
Return the list of pixel formats supported by VTK.
virtual void EnumerateDepthSwapchainImages(XrSwapchain swapchain, uint32_t eyeIndex)=0
Acquire swapchain images using xrEnumerateSwapchainImages and store them at the specified eye index.
virtual const void * GetGraphicsBinding()=0
Return pointer to the backend-specific XrGraphicsBindingXXX structure that is required to create the ...
virtual void GetDepthSwapchainImage(uint32_t eyeIndex, uint32_t imgIndex, void *texture)=0
Fill texture with the swapchain image for the specified eye.
vtkOpenXRManagerGraphics()=default
virtual void EnumerateColorSwapchainImages(XrSwapchain swapchain, uint32_t eyeIndex)=0
Acquire swapchain images using xrEnumerateSwapchainImages and store them at the specified eye index.
virtual void GetColorSwapchainImage(uint32_t eyeIndex, uint32_t imgIndex, void *texture)=0
Fill texture with the swapchain image for the specified eye.
virtual const char * GetBackendExtensionName()=0
Return the extension name to enable a specific rendering backend.
virtual bool CreateGraphicsBinding(vtkOpenGLRenderWindow *helperWindow)=0
Create the graphics binding and store it in GraphicsBindings ptr.
~vtkOpenXRManagerGraphics() override=default
Defines the OpenXR types and extensions common to all platforms.