Blender V4.3
GHOST_ContextD3D.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2014-2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#ifndef WIN32
12# error WIN32 only!
13#endif // WIN32
14
15#include <D3D11.h>
16
17#include "GHOST_Context.hh"
18
20 /* XR code needs low level graphics data to send to OpenXR. */
22
23 public:
24 GHOST_ContextD3D(bool stereoVisual, HWND hWnd);
26
32
38
44
50
60
66
73 {
74 return GHOST_kFailure;
75 }
76
83 {
84 return GHOST_kFailure;
85 }
86
91 unsigned int getDefaultFramebuffer()
92 {
93 return 0;
94 }
95
97 unsigned int width,
98 unsigned int height,
99 DXGI_FORMAT format,
100 ID3D11RenderTargetView *render_target);
102 unsigned int height,
103 DXGI_FORMAT format);
106 unsigned int width,
107 unsigned int height);
108 ID3D11Texture2D *getSharedTexture2D(class GHOST_SharedOpenGLResource *shared_res);
109
110 bool isUpsideDown() const
111 {
112 return true;
113 }
114
115 private:
116 GHOST_TSuccess setupD3DLib();
117
118 static HMODULE s_d3d_lib;
119 static PFN_D3D11_CREATE_DEVICE s_D3D11CreateDeviceFn;
120
121 HWND m_hWnd;
122
123 ID3D11Device *m_device;
124 ID3D11DeviceContext *m_device_ctx;
125};
GHOST_TSuccess
Definition GHOST_Types.h:87
@ GHOST_kFailure
Definition GHOST_Types.h:87
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