Blender  V2.93
GHOST_IXrGraphicsBinding.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #include <memory>
24 #include <optional>
25 #include <string>
26 #include <vector>
27 
29 
31  public:
32  union {
33 #if defined(WITH_GHOST_X11)
34  XrGraphicsBindingOpenGLXlibKHR glx;
35 #elif defined(WIN32)
36  XrGraphicsBindingOpenGLWin32KHR wgl;
37  XrGraphicsBindingD3D11KHR d3d11;
38 #endif
40 
41  virtual ~GHOST_IXrGraphicsBinding() = default;
42 
50  virtual bool checkVersionRequirements(class GHOST_Context &ghost_ctx,
51  XrInstance instance,
52  XrSystemId system_id,
53  std::string *r_requirement_info) const = 0;
54  virtual void initFromGhostContext(class GHOST_Context &ghost_ctx) = 0;
55  virtual std::optional<int64_t> chooseSwapchainFormat(const std::vector<int64_t> &runtime_formats,
56  bool &r_is_rgb_format) const = 0;
57  virtual std::vector<XrSwapchainImageBaseHeader *> createSwapchainImages(
58  uint32_t image_count) = 0;
59  virtual void submitToSwapchainImage(XrSwapchainImageBaseHeader &swapchain_image,
60  const GHOST_XrDrawViewInfo &draw_info) = 0;
61  virtual bool needsUpsideDownDrawing(GHOST_Context &ghost_ctx) const = 0;
62 
63  protected:
64  /* Use GHOST_XrGraphicsBindingCreateFromType! */
66 };
67 
68 std::unique_ptr<GHOST_IXrGraphicsBinding> GHOST_XrGraphicsBindingCreateFromType(
69  GHOST_TXrGraphicsBinding type, GHOST_Context &ghost_ctx);
std::unique_ptr< GHOST_IXrGraphicsBinding > GHOST_XrGraphicsBindingCreateFromType(GHOST_TXrGraphicsBinding type, GHOST_Context &ghost_ctx)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
virtual ~GHOST_IXrGraphicsBinding()=default
GHOST_IXrGraphicsBinding()=default
virtual bool needsUpsideDownDrawing(GHOST_Context &ghost_ctx) const =0
virtual bool checkVersionRequirements(class GHOST_Context &ghost_ctx, XrInstance instance, XrSystemId system_id, std::string *r_requirement_info) const =0
virtual void initFromGhostContext(class GHOST_Context &ghost_ctx)=0
union GHOST_IXrGraphicsBinding::@1230 oxr_binding
virtual std::vector< XrSwapchainImageBaseHeader * > createSwapchainImages(uint32_t image_count)=0
virtual std::optional< int64_t > chooseSwapchainFormat(const std::vector< int64_t > &runtime_formats, bool &r_is_rgb_format) const =0
virtual void submitToSwapchainImage(XrSwapchainImageBaseHeader &swapchain_image, const GHOST_XrDrawViewInfo &draw_info)=0
unsigned int uint32_t
Definition: stdint.h:83