2 * Copyright 2014 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 const UINT DXGI_ENUM_MODES_STEREO
= 0x4;
22 const UINT DXGI_ENUM_MODES_DISABLED_STEREO
= 0x8;
24 const DWORD DXGI_SHARED_RESOURCE_READ
= 0x80000000;
25 const DWORD DXGI_SHARED_RESOURCE_WRITE
= 0x00000001;
27 typedef enum _DXGI_OFFER_RESOURCE_PRIORITY
{
28 DXGI_OFFER_RESOURCE_PRIORITY_LOW
= 1,
29 DXGI_OFFER_RESOURCE_PRIORITY_NORMAL
,
30 DXGI_OFFER_RESOURCE_PRIORITY_HIGH
31 } DXGI_OFFER_RESOURCE_PRIORITY
;
33 typedef enum DXGI_ALPHA_MODE
{
34 DXGI_ALPHA_MODE_UNSPECIFIED
= 0,
35 DXGI_ALPHA_MODE_PREMULTIPLIED
= 1,
36 DXGI_ALPHA_MODE_STRAIGHT
= 2,
37 DXGI_ALPHA_MODE_IGNORE
= 3,
38 DXGI_ALPHA_MODE_FORCE_DWORD
= 0xffffffff
41 typedef struct DXGI_OUTDUPL_MOVE_RECT
45 } DXGI_OUTDUPL_MOVE_RECT
;
47 typedef struct DXGI_OUTDUPL_DESC
49 DXGI_MODE_DESC ModeDesc
;
50 DXGI_MODE_ROTATION Rotation
;
51 BOOL DesktopImageInSystemMemory
;
54 typedef struct DXGI_OUTDUPL_POINTER_POSITION
58 } DXGI_OUTDUPL_POINTER_POSITION
;
60 typedef enum DXGI_OUTDUPL_POINTER_SHAPE_TYPE
62 DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MONOCHROME
= 0x00000001,
63 DXGI_OUTDUPL_POINTER_SHAPE_TYPE_COLOR
= 0x00000002,
64 DXGI_OUTDUPL_POINTER_SHAPE_TYPE_MASKED_COLOR
= 0x00000004
65 } DXGI_OUTDUPL_POINTER_SHAPE_TYPE
;
67 typedef struct DXGI_OUTDUPL_POINTER_SHAPE_INFO
74 } DXGI_OUTDUPL_POINTER_SHAPE_INFO
;
76 typedef struct DXGI_OUTDUPL_FRAME_INFO
78 LARGE_INTEGER LastPresentTime
;
79 LARGE_INTEGER LastMouseUpdateTime
;
80 UINT AccumulatedFrames
;
82 BOOL ProtectedContentMaskedOut
;
83 DXGI_OUTDUPL_POINTER_POSITION PointerPosition
;
84 UINT TotalMetadataBufferSize
;
85 UINT PointerShapeBufferSize
;
86 } DXGI_OUTDUPL_FRAME_INFO
;
88 typedef struct DXGI_MODE_DESC1
92 DXGI_RATIONAL RefreshRate
;
94 DXGI_MODE_SCANLINE_ORDER ScanlineOrdering
;
95 DXGI_MODE_SCALING Scaling
;
101 uuid(191cfac3
-a341
-470d
-b26e
-a864f428319c
),
103 pointer_default(unique)
105 interface IDXGIOutputDuplication
: IDXGIObject
108 [out] DXGI_OUTDUPL_DESC
*desc
111 HRESULT AcquireNextFrame
(
112 [in] UINT timeout_in_milliseconds
,
113 [out] DXGI_OUTDUPL_FRAME_INFO
*frame_info
,
114 [out] IDXGIResource
**desktop_resource
117 HRESULT GetFrameDirtyRects
(
118 [in] UINT dirty_rects_buffer_size
,
119 [out] RECT
*dirty_rects_buffer
,
120 [out] UINT
*dirty_rects_buffer_size_required
123 HRESULT GetFrameMoveRects
(
124 [in] UINT move_rects_buffer_size
,
125 [out] DXGI_OUTDUPL_MOVE_RECT
*move_rect_buffer
,
126 [out] UINT
*move_rects_buffer_size_required
129 HRESULT GetFramePointerShape
(
130 [in] UINT pointer_shape_buffer_size
,
131 [out] void *pointer_shape_buffer
,
132 [out] UINT
*pointer_shape_buffer_size_required
,
133 [out] DXGI_OUTDUPL_POINTER_SHAPE_INFO
*pointer_shape_info
136 HRESULT MapDesktopSurface
(
137 [out] DXGI_MAPPED_RECT
*locked_rect
140 HRESULT UnMapDesktopSurface
();
142 HRESULT ReleaseFrame
();
147 uuid(aba496dd
-b617
-4cb8
-a866
-bc44d7eb1fa2
),
149 pointer_default(unique)
151 interface IDXGISurface2
: IDXGISurface1
155 [out] void **parent_resource
,
156 [out] UINT
*subresource_idx
162 uuid(30961379-4609-4a41
-998e-54fe567ee0c1
),
164 pointer_default(unique)
166 interface IDXGIResource1
: IDXGIResource
168 HRESULT CreateSubresourceSurface
(
170 [out] IDXGISurface2
**surface
172 HRESULT CreateSharedHandle
(
173 [in] const SECURITY_ATTRIBUTES
*attributes
,
175 [in] const WCHAR
*name
,
182 uuid(ea9dbf1a
-c88e
-4486
-854a
-98aa0138f30c
),
184 pointer_default(unique)
186 interface IDXGIDisplayControl
: IUnknown
188 BOOL IsStereoEnabled
();
189 void SetStereoEnabled
(BOOL enabled
);
194 uuid(05008617-fbfd
-4051-a790
-144884b4f6a9
),
196 pointer_default(unique)
198 interface IDXGIDevice2
: IDXGIDevice1
200 HRESULT OfferResources
(
201 [in] UINT NumResources
,
202 [in, size_is(NumResources
)] IDXGIResource
*const *ppResources
,
203 [in] DXGI_OFFER_RESOURCE_PRIORITY Priority
);
205 HRESULT ReclaimResources
(
206 [in] UINT NumResources
,
207 [in, size_is(NumResources
)] IDXGIResource
*const *ppResources
,
208 [out, size_is(NumResources
)] BOOL
*pDiscarded
);
210 HRESULT EnqueueSetEvent
(
214 typedef enum DXGI_SCALING
{
215 DXGI_SCALING_STRETCH
= 0,
216 DXGI_SCALING_NONE
= 1
219 typedef struct DXGI_SWAP_CHAIN_DESC1
{
224 DXGI_SAMPLE_DESC SampleDesc
;
225 DXGI_USAGE BufferUsage
;
227 DXGI_SCALING Scaling
;
228 DXGI_SWAP_EFFECT SwapEffect
;
229 DXGI_ALPHA_MODE AlphaMode
;
231 } DXGI_SWAP_CHAIN_DESC1
;
233 typedef struct DXGI_SWAP_CHAIN_FULLSCREEN_DESC
{
234 DXGI_RATIONAL RefreshRate
;
235 DXGI_MODE_SCANLINE_ORDER ScanlineOrdering
;
236 DXGI_MODE_SCALING Scaling
;
238 } DXGI_SWAP_CHAIN_FULLSCREEN_DESC
;
240 typedef struct DXGI_PRESENT_PARAMETERS
{
241 UINT DirtyRectsCount
;
244 POINT
*pScrollOffset
;
245 } DXGI_PRESENT_PARAMETERS
;
249 uuid(790a45f7
-0d42
-4876-983a
-0a55cfe6f4aa
),
251 pointer_default(unique)
253 interface IDXGISwapChain1
: IDXGISwapChain
256 [out] DXGI_SWAP_CHAIN_DESC1
*pDesc
);
258 HRESULT GetFullscreenDesc
(
259 [out] DXGI_SWAP_CHAIN_FULLSCREEN_DESC
*pDesc
);
264 HRESULT GetCoreWindow
(
269 [in] UINT SyncInterval
,
270 [in] UINT PresentFlags
,
271 [in] const DXGI_PRESENT_PARAMETERS
*pPresentParameters
);
273 BOOL IsTemporaryMonoSupported
();
275 HRESULT GetRestrictToOutput
(
276 [out] IDXGIOutput
**ppRestrictToOutput
);
278 HRESULT SetBackgroundColor
(
279 [in] const DXGI_RGBA
*pColor
);
281 HRESULT GetBackgroundColor
(
282 [out] DXGI_RGBA
*pColor
);
285 [in] DXGI_MODE_ROTATION Rotation
);
288 [out] DXGI_MODE_ROTATION
*pRotation
);
293 uuid(50c83a1c
-e072
-4c48
-87b0
-3630fa36a6d0
),
295 pointer_default(unique)
297 interface IDXGIFactory2
: IDXGIFactory1
299 BOOL IsWindowedStereoEnabled
();
301 HRESULT CreateSwapChainForHwnd
(
302 [in] IUnknown
*pDevice
,
304 [in] const DXGI_SWAP_CHAIN_DESC1
*pDesc
,
305 [in] const DXGI_SWAP_CHAIN_FULLSCREEN_DESC
*pFullscreenDesc
,
306 [in] IDXGIOutput
*pRestrictToOutput
,
307 [out] IDXGISwapChain1
**ppSwapChain
);
309 HRESULT CreateSwapChainForCoreWindow
(
310 [in] IUnknown
*pDevice
,
311 [in] IUnknown
*pWindow
,
312 [in] const DXGI_SWAP_CHAIN_DESC1
*pDesc
,
313 [in] IDXGIOutput
*pRestrictToOutput
,
314 [out] IDXGISwapChain1
**ppSwapChain
);
316 HRESULT GetSharedResourceAdapterLuid
(
317 [in] HANDLE hResource
,
320 HRESULT RegisterOcclusionStatusWindow
(
321 [in] HWND WindowHandle
,
323 [out] DWORD
*pdwCookie
);
325 HRESULT RegisterStereoStatusEvent
(
327 [out] DWORD
*pdwCookie
);
329 void UnregisterStereoStatus
(
330 [in] DWORD dwCookie
);
332 HRESULT RegisterStereoStatusWindow
(
333 [in] HWND WindowHandle
,
335 [out] DWORD
*pdwCookie
);
337 HRESULT RegisterOcclusionStatusEvent
(
339 [out] DWORD
*pdwCookie
);
341 void UnregisterOcclusionStatus
(
342 [in] DWORD dwCookie
);
344 HRESULT CreateSwapChainForComposition
(
345 [in] IUnknown
*pDevice
,
346 [in] const DXGI_SWAP_CHAIN_DESC1
*pDesc
,
347 [in] IDXGIOutput
*pRestrictToOutput
,
348 [out] IDXGISwapChain1
**ppSwapChain
);
351 typedef enum DXGI_GRAPHICS_PREEMPTION_GRANULARITY
{
352 DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY
,
353 DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY
,
354 DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY
,
355 DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY
,
356 DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY
357 } DXGI_GRAPHICS_PREEMPTION_GRANULARITY
;
359 typedef enum DXGI_COMPUTE_PREEMPTION_GRANULARITY
{
360 DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY
,
361 DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY
,
362 DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY
,
363 DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY
,
364 DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY
365 } DXGI_COMPUTE_PREEMPTION_GRANULARITY
;
367 typedef struct DXGI_ADAPTER_DESC2
{
368 WCHAR Description
[128];
373 SIZE_T DedicatedVideoMemory
;
374 SIZE_T DedicatedSystemMemory
;
375 SIZE_T SharedSystemMemory
;
378 DXGI_GRAPHICS_PREEMPTION_GRANULARITY GraphicsPreemptionGranularity
;
379 DXGI_COMPUTE_PREEMPTION_GRANULARITY ComputePreemptionGranularity
;
380 } DXGI_ADAPTER_DESC2
;
384 uuid(0aa1ae0a
-fa0e
-4b84
-8644-e05ff8e5acb5
),
386 pointer_default(unique)
388 interface IDXGIAdapter2
: IDXGIAdapter1
390 HRESULT GetDesc2
([out] DXGI_ADAPTER_DESC2
*pDesc
);
395 uuid(00cddea8
-939b
-4b83
-a340
-a685226666cc
),
397 pointer_default(unique)
399 interface IDXGIOutput1
: IDXGIOutput
401 HRESULT GetDisplayModeList1
(
402 [in] DXGI_FORMAT enum_format
,
404 [in, out] UINT
*num_modes
,
405 [out] DXGI_MODE_DESC1
*desc
408 HRESULT FindClosestMatchingMode1
(
409 [in] const DXGI_MODE_DESC1
*mode_to_match
,
410 [out] DXGI_MODE_DESC1
*closest_match
,
411 [in] IUnknown
*concerned_device
414 HRESULT GetDisplaySurfaceData1
(
415 [in] IDXGIResource
*destination
418 HRESULT DuplicateOutput
(
419 [in] IUnknown
*device
,
420 [out] IDXGIOutputDuplication
**output_duplication