Blender  V2.93
GHOST_ContextD3D.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 #ifndef WIN32
24 # error WIN32 only!
25 #endif // WIN32
26 
27 #include <D3D11.h>
28 
29 #include "GHOST_Context.h"
30 
32  /* XR code needs low level graphics data to send to OpenXR. */
34 
35  public:
36  GHOST_ContextD3D(bool stereoVisual, HWND hWnd);
38 
44 
50 
56 
62 
69  {
70  return GHOST_kFailure;
71  }
72 
78 
84  GHOST_TSuccess setSwapInterval(int /*interval*/)
85  {
86  return GHOST_kFailure;
87  }
88 
95  {
96  return GHOST_kFailure;
97  }
98 
103  unsigned int getDefaultFramebuffer()
104  {
105  return 0;
106  }
107 
109  unsigned int width, unsigned int height, ID3D11RenderTargetView *render_target);
111  unsigned int height);
114  unsigned int width,
115  unsigned int height);
116  ID3D11Texture2D *getSharedTexture2D(class GHOST_SharedOpenGLResource *shared_res);
117 
118  bool isUpsideDown() const
119  {
120  return true;
121  }
122 
123  private:
124  GHOST_TSuccess setupD3DLib();
125 
126  static HMODULE s_d3d_lib;
127  static PFN_D3D11_CREATE_DEVICE s_D3D11CreateDeviceFn;
128 
129  HWND m_hWnd;
130 
131  ID3D11Device *m_device;
132  ID3D11DeviceContext *m_device_ctx;
133 };
GHOST_TSuccess
Definition: GHOST_Types.h:91
@ GHOST_kFailure
Definition: GHOST_Types.h:91
_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
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
GHOST_TSuccess activateDrawingContext()
GHOST_TSuccess releaseNativeHandles()
class GHOST_SharedOpenGLResource * createSharedOpenGLResource(unsigned int width, unsigned int height, ID3D11RenderTargetView *render_target)
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 &)
GHOST_TSuccess initializeDrawingContext()
void disposeSharedOpenGLResource(class GHOST_SharedOpenGLResource *shared_res)
GHOST_TSuccess releaseDrawingContext()
bool isUpsideDown() const
GHOST_TSuccess updateDrawingContext()