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,
217 DXGI_SCALING_ASPECT_RATIO_STRETCH
= 2,
220 typedef struct DXGI_SWAP_CHAIN_DESC1
{
225 DXGI_SAMPLE_DESC SampleDesc
;
226 DXGI_USAGE BufferUsage
;
228 DXGI_SCALING Scaling
;
229 DXGI_SWAP_EFFECT SwapEffect
;
230 DXGI_ALPHA_MODE AlphaMode
;
232 } DXGI_SWAP_CHAIN_DESC1
;
234 typedef struct DXGI_SWAP_CHAIN_FULLSCREEN_DESC
{
235 DXGI_RATIONAL RefreshRate
;
236 DXGI_MODE_SCANLINE_ORDER ScanlineOrdering
;
237 DXGI_MODE_SCALING Scaling
;
239 } DXGI_SWAP_CHAIN_FULLSCREEN_DESC
;
241 typedef struct DXGI_PRESENT_PARAMETERS
{
242 UINT DirtyRectsCount
;
245 POINT
*pScrollOffset
;
246 } DXGI_PRESENT_PARAMETERS
;
250 uuid(790a45f7
-0d42
-4876-983a
-0a55cfe6f4aa
),
252 pointer_default(unique)
254 interface IDXGISwapChain1
: IDXGISwapChain
257 [out] DXGI_SWAP_CHAIN_DESC1
*pDesc
);
259 HRESULT GetFullscreenDesc
(
260 [out] DXGI_SWAP_CHAIN_FULLSCREEN_DESC
*pDesc
);
265 HRESULT GetCoreWindow
(
270 [in] UINT SyncInterval
,
271 [in] UINT PresentFlags
,
272 [in] const DXGI_PRESENT_PARAMETERS
*pPresentParameters
);
274 BOOL IsTemporaryMonoSupported
();
276 HRESULT GetRestrictToOutput
(
277 [out] IDXGIOutput
**ppRestrictToOutput
);
279 HRESULT SetBackgroundColor
(
280 [in] const DXGI_RGBA
*pColor
);
282 HRESULT GetBackgroundColor
(
283 [out] DXGI_RGBA
*pColor
);
286 [in] DXGI_MODE_ROTATION Rotation
);
289 [out] DXGI_MODE_ROTATION
*pRotation
);
294 uuid(50c83a1c
-e072
-4c48
-87b0
-3630fa36a6d0
),
296 pointer_default(unique)
298 interface IDXGIFactory2
: IDXGIFactory1
300 BOOL IsWindowedStereoEnabled
();
302 HRESULT CreateSwapChainForHwnd
(
303 [in] IUnknown
*pDevice
,
305 [in] const DXGI_SWAP_CHAIN_DESC1
*pDesc
,
306 [in] const DXGI_SWAP_CHAIN_FULLSCREEN_DESC
*pFullscreenDesc
,
307 [in] IDXGIOutput
*pRestrictToOutput
,
308 [out] IDXGISwapChain1
**ppSwapChain
);
310 HRESULT CreateSwapChainForCoreWindow
(
311 [in] IUnknown
*pDevice
,
312 [in] IUnknown
*pWindow
,
313 [in] const DXGI_SWAP_CHAIN_DESC1
*pDesc
,
314 [in] IDXGIOutput
*pRestrictToOutput
,
315 [out] IDXGISwapChain1
**ppSwapChain
);
317 HRESULT GetSharedResourceAdapterLuid
(
318 [in] HANDLE hResource
,
321 HRESULT RegisterStereoStatusWindow
(
322 [in] HWND WindowHandle
,
324 [out] DWORD
*pdwCookie
);
326 HRESULT RegisterStereoStatusEvent
(
328 [out] DWORD
*pdwCookie
);
330 void UnregisterStereoStatus
(
331 [in] DWORD dwCookie
);
333 HRESULT RegisterOcclusionStatusWindow
(
334 [in] HWND WindowHandle
,
336 [out] DWORD
*pdwCookie
);
338 HRESULT RegisterOcclusionStatusEvent
(
340 [out] DWORD
*pdwCookie
);
342 void UnregisterOcclusionStatus
(
343 [in] DWORD dwCookie
);
345 HRESULT CreateSwapChainForComposition
(
346 [in] IUnknown
*pDevice
,
347 [in] const DXGI_SWAP_CHAIN_DESC1
*pDesc
,
348 [in] IDXGIOutput
*pRestrictToOutput
,
349 [out] IDXGISwapChain1
**ppSwapChain
);
352 typedef enum DXGI_GRAPHICS_PREEMPTION_GRANULARITY
{
353 DXGI_GRAPHICS_PREEMPTION_DMA_BUFFER_BOUNDARY
,
354 DXGI_GRAPHICS_PREEMPTION_PRIMITIVE_BOUNDARY
,
355 DXGI_GRAPHICS_PREEMPTION_TRIANGLE_BOUNDARY
,
356 DXGI_GRAPHICS_PREEMPTION_PIXEL_BOUNDARY
,
357 DXGI_GRAPHICS_PREEMPTION_INSTRUCTION_BOUNDARY
358 } DXGI_GRAPHICS_PREEMPTION_GRANULARITY
;
360 typedef enum DXGI_COMPUTE_PREEMPTION_GRANULARITY
{
361 DXGI_COMPUTE_PREEMPTION_DMA_BUFFER_BOUNDARY
,
362 DXGI_COMPUTE_PREEMPTION_DISPATCH_BOUNDARY
,
363 DXGI_COMPUTE_PREEMPTION_THREAD_GROUP_BOUNDARY
,
364 DXGI_COMPUTE_PREEMPTION_THREAD_BOUNDARY
,
365 DXGI_COMPUTE_PREEMPTION_INSTRUCTION_BOUNDARY
366 } DXGI_COMPUTE_PREEMPTION_GRANULARITY
;
368 typedef struct DXGI_ADAPTER_DESC2
{
369 WCHAR Description
[128];
374 SIZE_T DedicatedVideoMemory
;
375 SIZE_T DedicatedSystemMemory
;
376 SIZE_T SharedSystemMemory
;
379 DXGI_GRAPHICS_PREEMPTION_GRANULARITY GraphicsPreemptionGranularity
;
380 DXGI_COMPUTE_PREEMPTION_GRANULARITY ComputePreemptionGranularity
;
381 } DXGI_ADAPTER_DESC2
;
385 uuid(0aa1ae0a
-fa0e
-4b84
-8644-e05ff8e5acb5
),
387 pointer_default(unique)
389 interface IDXGIAdapter2
: IDXGIAdapter1
391 HRESULT GetDesc2
([out] DXGI_ADAPTER_DESC2
*pDesc
);
396 uuid(00cddea8
-939b
-4b83
-a340
-a685226666cc
),
398 pointer_default(unique)
400 interface IDXGIOutput1
: IDXGIOutput
402 HRESULT GetDisplayModeList1
(
403 [in] DXGI_FORMAT enum_format
,
405 [in, out] UINT
*num_modes
,
406 [out] DXGI_MODE_DESC1
*desc
409 HRESULT FindClosestMatchingMode1
(
410 [in] const DXGI_MODE_DESC1
*mode_to_match
,
411 [out] DXGI_MODE_DESC1
*closest_match
,
412 [in] IUnknown
*concerned_device
415 HRESULT GetDisplaySurfaceData1
(
416 [in] IDXGIResource
*destination
419 HRESULT DuplicateOutput
(
420 [in] IUnknown
*device
,
421 [out] IDXGIOutputDuplication
**output_duplication