VTK  9.6.20260509
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
15
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
25namespace vtk::detail
26{
27VTK_ABI_NAMESPACE_BEGIN
29VTK_ABI_NAMESPACE_END
30}
31
32VTK_ABI_NAMESPACE_BEGIN
34
35class VTKRENDERINGOPENXR_EXPORT vtkOpenXRManagerGraphics : public vtkObject
36{
37public:
39
43 virtual void SetNumberOfSwapchains(uint32_t viewCount) = 0;
44
46
50 virtual void GetColorSwapchainImage(uint32_t eyeIndex, uint32_t imgIndex, void* texture) = 0;
51 virtual void GetDepthSwapchainImage(uint32_t eyeIndex, uint32_t imgIndex, void* texture) = 0;
53
55
59 virtual void EnumerateColorSwapchainImages(XrSwapchain swapchain, uint32_t eyeIndex) = 0;
60 virtual void EnumerateDepthSwapchainImages(XrSwapchain swapchain, uint32_t eyeIndex) = 0;
62
66 uint32_t GetChainLength(XrSwapchain swapchain);
67
69
73 virtual const std::vector<int64_t>& GetSupportedColorFormats() = 0;
74 virtual const std::vector<int64_t>& GetSupportedDepthFormats() = 0;
76
83 virtual bool CreateGraphicsBinding(vtkOpenGLRenderWindow* helperWindow) = 0;
84
89 virtual const void* GetGraphicsBinding() = 0;
90
94 virtual const char* GetBackendExtensionName() = 0;
95
96protected:
98 ~vtkOpenXRManagerGraphics() override = default;
99
105 friend class vtk::detail::vtkOpenXRManager; // for vtkOpenXRManager::Initialize
106
107private:
109 void operator=(const vtkOpenXRManagerGraphics&) = delete;
110};
111
112VTK_ABI_NAMESPACE_END
113#endif
OpenGL rendering window.
uint32_t GetChainLength(XrSwapchain swapchain)
Acquire the number of images in the specified swapchain.
virtual const void * GetGraphicsBinding()=0
Return pointer to the backend-specific XrGraphicsBindingXXX structure that is required to create the ...
virtual bool CheckGraphicsRequirements(vtk::detail::vtkOpenXRManager &manager)=0
OpenXR requires checking graphics requirements before creating a session.
virtual const char * GetBackendExtensionName()=0
Return the extension name to enable a specific rendering backend.
virtual void SetNumberOfSwapchains(uint32_t viewCount)=0
Resize the internal vectors storing the color and depth swapchains.
virtual void EnumerateDepthSwapchainImages(XrSwapchain swapchain, uint32_t eyeIndex)=0
Acquire swapchain images using xrEnumerateSwapchainImages and store them at the specified eye index.
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 const std::vector< int64_t > & GetSupportedDepthFormats()=0
Return the list of pixel formats supported by VTK.
virtual const std::vector< int64_t > & GetSupportedColorFormats()=0
Return the list of pixel formats supported by VTK.
virtual void GetColorSwapchainImage(uint32_t eyeIndex, uint32_t imgIndex, void *texture)=0
Fill texture with the swapchain image for the specified eye.
virtual bool CreateGraphicsBinding(vtkOpenGLRenderWindow *helperWindow)=0
Create the graphics binding and store it in GraphicsBindings ptr.
~vtkOpenXRManagerGraphics() override=default
Singleton class that holds a collection of utility functions and member variables to communicate with...
Defines the OpenXR types and extensions common to all platforms.