Blender  V3.3
GHOST_ContextD3D.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #pragma once
8 
9 #ifndef WIN32
10 # error WIN32 only!
11 #endif // WIN32
12 
13 #include <D3D11.h>
14 
15 #include "GHOST_Context.h"
16 
18  /* XR code needs low level graphics data to send to OpenXR. */
20 
21  public:
22  GHOST_ContextD3D(bool stereoVisual, HWND hWnd);
24 
30 
36 
42 
48 
55  {
56  return GHOST_kFailure;
57  }
58 
64 
70  GHOST_TSuccess setSwapInterval(int /*interval*/)
71  {
72  return GHOST_kFailure;
73  }
74 
81  {
82  return GHOST_kFailure;
83  }
84 
89  unsigned int getDefaultFramebuffer()
90  {
91  return 0;
92  }
93 
95  unsigned int width,
96  unsigned int height,
98  ID3D11RenderTargetView *render_target);
100  unsigned int height,
104  unsigned int width,
105  unsigned int height);
106  ID3D11Texture2D *getSharedTexture2D(class GHOST_SharedOpenGLResource *shared_res);
107 
108  bool isUpsideDown() const
109  {
110  return true;
111  }
112 
113  private:
114  GHOST_TSuccess setupD3DLib();
115 
116  static HMODULE s_d3d_lib;
117  static PFN_D3D11_CREATE_DEVICE s_D3D11CreateDeviceFn;
118 
119  HWND m_hWnd;
120 
121  ID3D11Device *m_device;
122  ID3D11DeviceContext *m_device_ctx;
123 };
GHOST_TSuccess
Definition: GHOST_Types.h:74
@ GHOST_kFailure
Definition: GHOST_Types.h:74
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_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 const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
GHOST_TSuccess activateDrawingContext()
GHOST_TSuccess releaseNativeHandles()
GHOST_TSuccess setSwapInterval(int)
GHOST_TSuccess swapBuffers()
friend class GHOST_XrGraphicsBindingD3D
GHOST_ContextD3D(bool stereoVisual, HWND hWnd)
unsigned int getDefaultFramebuffer()
GHOST_TSuccess blitFromOpenGLContext(class GHOST_SharedOpenGLResource *shared_res, unsigned int width, unsigned int height)
ID3D11Texture2D * getSharedTexture2D(class GHOST_SharedOpenGLResource *shared_res)
GHOST_TSuccess getSwapInterval(int &)
class GHOST_SharedOpenGLResource * createSharedOpenGLResource(unsigned int width, unsigned int height, DXGI_FORMAT format, ID3D11RenderTargetView *render_target)
GHOST_TSuccess initializeDrawingContext()
void disposeSharedOpenGLResource(class GHOST_SharedOpenGLResource *shared_res)
GHOST_TSuccess releaseDrawingContext()
bool isUpsideDown() const
GHOST_TSuccess updateDrawingContext()
format
Definition: logImageCore.h:38