CommonLibSSE (powerof3)
DXGI_2.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "REX/W32/DXGI.h"
4 
5 namespace REX::W32
6 {
7  struct IDXGIAdapter2;
8  struct IDXGIDevice2;
9  struct IDXGIDisplayControl;
10  struct IDXGIFactory2;
11  struct IDXGIOutput1;
12  struct IDXGIOutputDuplication;
13  struct IDXGIResource1;
14  struct IDXGISurface2;
15  struct IDXGISwapChain1;
16 }
17 
18 namespace REX::W32
19 {
21  {
27  };
28 
30  {
36  };
37 
39  {
45  };
46 
48  {
52  };
53 
55  {
59  };
60 
62  {
66  };
67 }
68 
69 namespace REX::W32
70 {
72  {
73  wchar_t description[128];
74  std::uint32_t vendorID;
75  std::uint32_t deviceID;
76  std::uint32_t subSysID;
77  std::uint32_t revision;
78  std::size_t dedicatedVideoMemory;
79  std::size_t dedicatedSystemMemory;
80  std::size_t sharedSystemMemory;
82  std::uint32_t flags;
85  };
86 
88  {
89  std::uint32_t width;
90  std::uint32_t height;
96  };
97 
99  {
103  };
104 
106  {
109  };
110 
112  {
113  std::int64_t lastPresentTime;
114  std::int64_t lastMouseUpdateTime;
115  std::uint32_t accumulatedFrames;
119  std::uint32_t totalMetadataBufferSize;
120  std::uint32_t pointerShapeBufferSize;
121  };
122 
124  {
127  };
128 
130  {
131  std::uint32_t type;
132  std::uint32_t width;
133  std::uint32_t height;
134  std::uint32_t pitch;
136  };
137 
139  {
140  std::uint32_t dirtyRectsCount;
144  };
145 
147  {
148  std::uint32_t width;
149  std::uint32_t height;
154  std::uint32_t bufferCount;
158  std::uint32_t flags;
159  };
160 
162  {
167  };
168 }
169 
170 namespace REX::W32
171 {
172  struct __declspec(novtable, uuid("0AA1AE0A-FA0E-4B84-8644-E05FF8E5ACB5"))
173  IDXGIAdapter2 : public IDXGIAdapter1
174  {
175  virtual HRESULT GetDesc2(DXGI_ADAPTER_DESC2* a_desc) = 0;
176  };
177 
178  struct __declspec(novtable, uuid("05008617-FBFD-4051-A790-144884B4F6A9"))
179  IDXGIDevice2 : public IDXGIDevice1
180  {
181  virtual HRESULT OfferResources(std::uint32_t a_numResources, IDXGIResource* const* a_resources, DXGI_OFFER_RESOURCE_PRIORITY a_priority) = 0;
182  virtual HRESULT ReclaimResources(std::uint32_t a_numResources, IDXGIResource* const* a_resources, BOOL* a_discarded) = 0;
183  virtual HRESULT EnqueueSetEvent(HANDLE a_event) = 0;
184  };
185 
186  struct __declspec(novtable, uuid("EA9DBF1A-C88E-4486-854A-98AA0138F30C"))
187  IDXGIDisplayControl : public IUnknown
188  {
189  virtual BOOL IsStereoEnabled(void) = 0;
190  virtual void SetStereoEnabled(BOOL a_enabled) = 0;
191  };
192 
193  struct __declspec(novtable, uuid("50C83A1C-E072-4C48-87B0-3630FA36A6D0"))
194  IDXGIFactory2 : public IDXGIFactory1
195  {
196  virtual BOOL IsWindowedStereoEnabled(void) = 0;
197  virtual HRESULT CreateSwapChainForHwnd(IUnknown* a_device, HWND a_wnd, const DXGI_SWAP_CHAIN_DESC1* a_desc, const DXGI_SWAP_CHAIN_FULLSCREEN_DESC* a_fullscreenDesc, IDXGIOutput* a_restrictToOutput, IDXGISwapChain1** a_swapChain) = 0;
198  virtual HRESULT CreateSwapChainForCoreWindow(IUnknown* a_device, IUnknown* a_window, const DXGI_SWAP_CHAIN_DESC1* a_desc, IDXGIOutput* a_restrictToOutput, IDXGISwapChain1** a_swapChain) = 0;
199  virtual HRESULT GetSharedResourceAdapterLuid(HANDLE a_resource, LUID* a_luid) = 0;
200  virtual HRESULT RegisterStereoStatusWindow(HWND a_wnd, std::uint32_t a_msg, std::uint32_t* a_cookie) = 0;
201  virtual HRESULT RegisterStereoStatusEvent(HANDLE a_event, std::uint32_t* a_cookie) = 0;
202  virtual void UnregisterStereoStatus(std::uint32_t a_cookie) = 0;
203  virtual HRESULT RegisterOcclusionStatusWindow(HWND a_wnd, std::uint32_t a_msg, std::uint32_t* a_cookie) = 0;
204  virtual HRESULT RegisterOcclusionStatusEvent(HANDLE a_event, std::uint32_t* a_cookie) = 0;
205  virtual void UnregisterOcclusionStatus(std::uint32_t dwCookie) = 0;
206  virtual HRESULT CreateSwapChainForComposition(IUnknown* a_device, const DXGI_SWAP_CHAIN_DESC1* a_desc, IDXGIOutput* a_restrictToOutput, IDXGISwapChain1** a_swapChain) = 0;
207  };
208 
209  struct __declspec(novtable, uuid("00CDDEA8-939B-4B83-A340-A685226666CC"))
210  IDXGIOutput1 : public IDXGIOutput
211  {
212  virtual HRESULT GetDisplayModeList1(DXGI_FORMAT a_enumFormat, std::uint32_t a_flags, std::uint32_t* a_numModes, DXGI_MODE_DESC1* a_desc) = 0;
213  virtual HRESULT FindClosestMatchingMode1(const DXGI_MODE_DESC1* a_modeToMatch, DXGI_MODE_DESC1* a_closestMatch, IUnknown* a_concernedDevice) = 0;
214  virtual HRESULT GetDisplaySurfaceData1(IDXGIResource* a_destination) = 0;
215  virtual HRESULT DuplicateOutput(IUnknown* a_device, IDXGIOutputDuplication** a_outputDuplication) = 0;
216  };
217 
218  struct __declspec(novtable, uuid("191CFAC3-A341-470D-B26E-A864F428319C"))
219  IDXGIOutputDuplication : public IDXGIObject
220  {
221  virtual void GetDesc(DXGI_OUTDUPL_DESC* a_desc) = 0;
222  virtual HRESULT AcquireNextFrame(std::uint32_t a_timeoutInMilliseconds, DXGI_OUTDUPL_FRAME_INFO* a_frameInfo, IDXGIResource** a_desktopResource) = 0;
223  virtual HRESULT GetFrameDirtyRects(std::uint32_t a_dirtyRectsBufferSize, RECT* a_dirtyRectsBuffer, std::uint32_t* a_dirtyRectsBufferSizeRequired) = 0;
224  virtual HRESULT GetFrameMoveRects(std::uint32_t a_moveRectsBufferSize, DXGI_OUTDUPL_MOVE_RECT* a_moveRectBuffer, std::uint32_t* a_moveRectsBufferSizeRequired) = 0;
225  virtual HRESULT GetFramePointerShape(std::uint32_t a_pointerShapeBufferSize, void* a_pointerShapeBuffer, std::uint32_t* a_pointerShapeBufferSizeRequired, DXGI_OUTDUPL_POINTER_SHAPE_INFO* a_pointerShapeInfo) = 0;
226  virtual HRESULT MapDesktopSurface(DXGI_MAPPED_RECT* a_lockedRect) = 0;
227  virtual HRESULT UnMapDesktopSurface(void) = 0;
228  virtual HRESULT ReleaseFrame(void) = 0;
229  };
230 
231  struct __declspec(novtable, uuid("30961379-4609-4A41-998E-54FE567EE0C1"))
232  IDXGIResource1 : public IDXGIResource
233  {
234  virtual HRESULT CreateSubresourceSurface(std::uint32_t a_index, IDXGISurface2** a_surface) = 0;
235  virtual HRESULT CreateSharedHandle(const SECURITY_ATTRIBUTES* a_attributes, std::uint32_t a_access, const wchar_t* a_name, HANDLE* a_handle) = 0;
236  };
237 
238  struct __declspec(novtable, uuid("ABA496DD-B617-4CB8-A866-BC44D7EB1FA2"))
239  IDXGISurface2 : public IDXGISurface1
240  {
241  virtual HRESULT GetResource(const IID& a_iid, void** a_parentResource, std::uint32_t* a_subresourceIndex) = 0;
242  };
243 
244  struct __declspec(novtable, uuid("790A45F7-0D42-4876-983A-0A55CFE6F4AA"))
245  IDXGISwapChain1 : public IDXGISwapChain
246  {
247  virtual HRESULT GetDesc1(DXGI_SWAP_CHAIN_DESC1* a_desc) = 0;
248  virtual HRESULT GetFullscreenDesc(DXGI_SWAP_CHAIN_FULLSCREEN_DESC* a_desc) = 0;
249  virtual HRESULT GetHwnd(HWND* a_wnd) = 0;
250  virtual HRESULT GetCoreWindow(const IID& a_iid, void** a_unk) = 0;
251  virtual HRESULT Present1(std::uint32_t a_syncInterval, std::uint32_t a_presentFlags, const DXGI_PRESENT_PARAMETERS* a_presentParameters) = 0;
252  virtual BOOL IsTemporaryMonoSupported(void) = 0;
253  virtual HRESULT GetRestrictToOutput(IDXGIOutput** a_restrictToOutput) = 0;
254  virtual HRESULT SetBackgroundColor(const DXGI_RGBA* a_color) = 0;
255  virtual HRESULT GetBackgroundColor(DXGI_RGBA* a_color) = 0;
256  virtual HRESULT SetRotation(DXGI_MODE_ROTATION a_rotation) = 0;
257  virtual HRESULT GetRotation(DXGI_MODE_ROTATION* a_rotation) = 0;
258  };
259 }
260 
261 namespace REX::W32
262 {
263  inline constexpr IID IID_IDXGIAdapter2{ 0x0AA1AE0A, 0xFA0E, 0x4B84, { 0x86, 0x44, 0xE0, 0x5F, 0xF8, 0xE5, 0xAC, 0xB5 } };
264  inline constexpr IID IID_IDXGIDevice2{ 0x05008617, 0xFBFD, 0x4051, { 0xA7, 0x90, 0x14, 0x48, 0x84, 0xB4, 0xF6, 0xA9 } };
265  inline constexpr IID IID_IDXGIDisplayControl{ 0xEA9DBF1A, 0xC88E, 0x4486, { 0x85, 0x4A, 0x98, 0xAA, 0x01, 0x38, 0xF3, 0x0C } };
266  inline constexpr IID IID_IDXGIFactory2{ 0x50C83A1C, 0xE072, 0x4C48, { 0x87, 0xB0, 0x36, 0x30, 0xFA, 0x36, 0xA6, 0xD0 } };
267  inline constexpr IID IID_IDXGIOutput1{ 0x00CDDEA8, 0x939B, 0x4B83, { 0xA3, 0x40, 0xA6, 0x85, 0x22, 0x66, 0x66, 0xCC } };
268  inline constexpr IID IID_IDXGIOutputDuplication{ 0x191CFAC3, 0xA341, 0x470D, { 0xB2, 0x6E, 0xA8, 0x64, 0xF4, 0x28, 0x31, 0x9C } };
269  inline constexpr IID IID_IDXGIResource1{ 0x30961379, 0x4609, 0x4A41, { 0x99, 0x8E, 0x54, 0xFE, 0x56, 0x7E, 0xE0, 0xC1 } };
270  inline constexpr IID IID_IDXGISurface2{ 0xABA496DD, 0xB617, 0x4CB8, { 0xA8, 0x66, 0xBC, 0x44, 0xD7, 0xEB, 0x1F, 0xA2 } };
271  inline constexpr IID IID_IDXGISwapChain1{ 0x790A45F7, 0x0D42, 0x4876, { 0x98, 0x3A, 0x0A, 0x55, 0xCF, 0xE6, 0xF4, 0xAA } };
272 }
Definition: BSDirectInputManager.h:8
DXGI_OUTDUPL_POINTER_SHAPE_TYPE
Definition: DXGI_2.h:55
@ DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR
Definition: DXGI_2.h:57
@ DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME
Definition: DXGI_2.h:56
@ DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR
Definition: DXGI_2.h:58
DXGI_COMPUTE_PREEMPTION_GRANULARITY
Definition: DXGI_2.h:30
@ DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY
Definition: DXGI_2.h:34
@ DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY
Definition: DXGI_2.h:35
@ DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY
Definition: DXGI_2.h:32
@ DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY
Definition: DXGI_2.h:31
@ DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY
Definition: DXGI_2.h:33
DXGI_MODE_SCALING
Definition: DXGI.h:201
void * HANDLE
Definition: BASE.h:14
DXGI_MODE_SCANLINE_ORDER
Definition: DXGI.h:208
constexpr IID IID_IDXGISurface2
Definition: DXGI_2.h:270
constexpr IID IID_IDXGIResource1
Definition: DXGI_2.h:269
constexpr IID IID_IDXGIOutput1
Definition: DXGI_2.h:267
struct __declspec(novtable, uuid("00000000-0000-0000-c000-000000000046")) IUnknown
Definition: COM.h:7
constexpr IID IID_IDXGIDisplayControl
Definition: DXGI_2.h:265
DXGI_SWAP_EFFECT
Definition: DXGI.h:223
constexpr IID IID_IDXGISwapChain1
Definition: DXGI_2.h:271
std::int32_t BOOL
Definition: BASE.h:13
DXGI_OFFER_RESOURCE_PRIORITY
Definition: DXGI_2.h:48
@ DXGI_OFFER_RESOURCE_PRIORITY_NORMAL
Definition: DXGI_2.h:50
@ DXGI_OFFER_RESOURCE_PRIORITY_HIGH
Definition: DXGI_2.h:51
@ DXGI_OFFER_RESOURCE_PRIORITY_LOW
Definition: DXGI_2.h:49
DXGI_GRAPHICS_PREEMPTION_GRANULARITY
Definition: DXGI_2.h:39
@ DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY
Definition: DXGI_2.h:43
@ DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY
Definition: DXGI_2.h:41
@ DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY
Definition: DXGI_2.h:44
@ DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY
Definition: DXGI_2.h:40
@ DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY
Definition: DXGI_2.h:42
constexpr IID IID_IDXGIOutputDuplication
Definition: DXGI_2.h:268
constexpr IID IID_IDXGIAdapter2
Definition: DXGI_2.h:263
DXGI_MODE_ROTATION
Definition: DXGI.h:192
DXGI_ALPHA_MODE
Definition: DXGI_2.h:21
@ DXGI_ALPHA_MODE_UNSPECIFIED
Definition: DXGI_2.h:22
@ DXGI_ALPHA_MODE_STRAIGHT
Definition: DXGI_2.h:24
@ DXGI_ALPHA_MODE_PREMULTIPLIED
Definition: DXGI_2.h:23
@ DXGI_ALPHA_MODE_FORCE_DWORD
Definition: DXGI_2.h:26
@ DXGI_ALPHA_MODE_IGNORE
Definition: DXGI_2.h:25
constexpr IID IID_IDXGIFactory2
Definition: DXGI_2.h:266
DXGI_SCALING
Definition: DXGI_2.h:62
@ DXGI_SCALING_STRETCH
Definition: DXGI_2.h:63
@ DXGI_SCALING_NONE
Definition: DXGI_2.h:64
@ DXGI_SCALING_ASPECT_RATIO_STRETCH
Definition: DXGI_2.h:65
D3DCOLORVALUE DXGI_RGBA
Definition: DXGI.h:258
std::uint32_t DXGI_USAGE
Definition: DXGI.h:259
DXGI_FORMAT
Definition: DXGI.h:63
constexpr IID IID_IDXGIDevice2
Definition: DXGI_2.h:264
struct HWND__ * HWND
Definition: BASE.h:30
std::int32_t HRESULT
Definition: BASE.h:28
GUID IID
Definition: BASE.h:88
Definition: DXGI_2.h:72
std::uint32_t vendorID
Definition: DXGI_2.h:74
std::uint32_t subSysID
Definition: DXGI_2.h:76
DXGI_GRAPHICS_PREEMPTION_GRANULARITY graphicsPreemptionGranularity
Definition: DXGI_2.h:83
std::size_t sharedSystemMemory
Definition: DXGI_2.h:80
std::uint32_t deviceID
Definition: DXGI_2.h:75
DXGI_COMPUTE_PREEMPTION_GRANULARITY computePreemptionGranularity
Definition: DXGI_2.h:84
wchar_t description[128]
Definition: DXGI_2.h:73
LUID adapterLUID
Definition: DXGI_2.h:81
std::size_t dedicatedSystemMemory
Definition: DXGI_2.h:79
std::size_t dedicatedVideoMemory
Definition: DXGI_2.h:78
std::uint32_t flags
Definition: DXGI_2.h:82
std::uint32_t revision
Definition: DXGI_2.h:77
Definition: DXGI_2.h:88
BOOL stereo
Definition: DXGI_2.h:95
std::uint32_t width
Definition: DXGI_2.h:89
DXGI_MODE_SCANLINE_ORDER scanlineOrdering
Definition: DXGI_2.h:93
std::uint32_t height
Definition: DXGI_2.h:90
DXGI_FORMAT format
Definition: DXGI_2.h:92
DXGI_MODE_SCALING scaling
Definition: DXGI_2.h:94
DXGI_RATIONAL refreshRate
Definition: DXGI_2.h:91
Definition: DXGI.h:348
Definition: DXGI_2.h:99
DXGI_MODE_DESC modeDesc
Definition: DXGI_2.h:100
BOOL desktopImageInSystemMemory
Definition: DXGI_2.h:102
DXGI_MODE_ROTATION rotation
Definition: DXGI_2.h:101
Definition: DXGI_2.h:112
std::uint32_t totalMetadataBufferSize
Definition: DXGI_2.h:119
std::uint32_t accumulatedFrames
Definition: DXGI_2.h:115
std::int64_t lastMouseUpdateTime
Definition: DXGI_2.h:114
std::uint32_t pointerShapeBufferSize
Definition: DXGI_2.h:120
BOOL protectedContentMaskedOut
Definition: DXGI_2.h:117
DXGI_OUTDUPL_POINTER_POSITION pointerPosition
Definition: DXGI_2.h:118
BOOL rectsCoalesced
Definition: DXGI_2.h:116
std::int64_t lastPresentTime
Definition: DXGI_2.h:113
Definition: DXGI_2.h:124
POINT sourcePoint
Definition: DXGI_2.h:125
RECT destinationRect
Definition: DXGI_2.h:126
BOOL visible
Definition: DXGI_2.h:108
POINT position
Definition: DXGI_2.h:107
std::uint32_t type
Definition: DXGI_2.h:131
std::uint32_t pitch
Definition: DXGI_2.h:134
std::uint32_t height
Definition: DXGI_2.h:133
std::uint32_t width
Definition: DXGI_2.h:132
POINT hotSpot
Definition: DXGI_2.h:135
Definition: DXGI_2.h:139
POINT * scrollOffset
Definition: DXGI_2.h:143
std::uint32_t dirtyRectsCount
Definition: DXGI_2.h:140
RECT * scrollRect
Definition: DXGI_2.h:142
RECT * dirtyRects
Definition: DXGI_2.h:141
Definition: DXGI.h:342
Definition: DXGI.h:367
Definition: DXGI_2.h:147
std::uint32_t width
Definition: DXGI_2.h:148
DXGI_SCALING scaling
Definition: DXGI_2.h:155
DXGI_FORMAT format
Definition: DXGI_2.h:150
DXGI_SAMPLE_DESC sampleDesc
Definition: DXGI_2.h:152
std::uint32_t flags
Definition: DXGI_2.h:158
std::uint32_t bufferCount
Definition: DXGI_2.h:154
DXGI_ALPHA_MODE alphaMode
Definition: DXGI_2.h:157
std::uint32_t height
Definition: DXGI_2.h:149
DXGI_SWAP_EFFECT swapEffect
Definition: DXGI_2.h:156
BOOL stereo
Definition: DXGI_2.h:151
DXGI_USAGE bufferUsage
Definition: DXGI_2.h:153
DXGI_MODE_SCANLINE_ORDER scanlineOrdering
Definition: DXGI_2.h:164
DXGI_MODE_SCALING scaling
Definition: DXGI_2.h:165
DXGI_RATIONAL refreshRate
Definition: DXGI_2.h:163
BOOL windowed
Definition: DXGI_2.h:166
Definition: BASE.h:63
Definition: DXGI.h:262
Definition: BASE.h:94
Definition: BASE.h:110