2 * Copyright 2007 Andras Kovacs
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 import
"dxgitype.idl";
23 const UINT _FACDXGI
= 0x87a;
25 cpp_quote
("#define MAKE_DXGI_STATUS(x) MAKE_HRESULT(0, _FACDXGI, x)")
26 cpp_quote
("#define MAKE_DXGI_HRESULT(x) MAKE_HRESULT(1, _FACDXGI, x)")
29 typedef HANDLE HMONITOR
;
30 typedef struct _LUID
{
36 const UINT DXGI_CPU_ACCESS_NONE
= 0;
37 const UINT DXGI_CPU_ACCESS_DYNAMIC
= 1;
38 const UINT DXGI_CPU_ACCESS_READ_WRITE
= 2;
39 const UINT DXGI_CPU_ACCESS_SCRATCH
= 3;
40 const UINT DXGI_CPU_ACCESS_FIELD
= 15;
42 typedef UINT DXGI_USAGE
;
43 const DXGI_USAGE DXGI_USAGE_SHADER_INPUT
= 0x10L
;
44 const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT
= 0x20L
;
45 const DXGI_USAGE DXGI_USAGE_BACK_BUFFER
= 0x40L
;
46 const DXGI_USAGE DXGI_USAGE_SHARED
= 0x80L
;
47 const DXGI_USAGE DXGI_USAGE_READ_ONLY
= 0x100L
;
48 const DXGI_USAGE DXGI_USAGE_DISCARD_ON_PRESENT
= 0x200L
;
49 const DXGI_USAGE DXGI_USAGE_UNORDERED_ACCESS
= 0x400L
;
51 const UINT DXGI_ENUM_MODES_INTERLACED
= 1;
52 const UINT DXGI_ENUM_MODES_SCALING
= 2;
54 const UINT DXGI_RESOURCE_PRIORITY_MINIMUM
= 0x28000000;
55 const UINT DXGI_RESOURCE_PRIORITY_LOW
= 0x50000000;
56 const UINT DXGI_RESOURCE_PRIORITY_NORMAL
= 0x78000000;
57 const UINT DXGI_RESOURCE_PRIORITY_HIGH
= 0xa0000000;
58 const UINT DXGI_RESOURCE_PRIORITY_MAXIMUM
= 0xc8000000;
60 const UINT DXGI_MAP_READ
= 0x1;
61 const UINT DXGI_MAP_WRITE
= 0x2;
62 const UINT DXGI_MAP_DISCARD
= 0x4;
64 typedef enum DXGI_SWAP_EFFECT
{
65 DXGI_SWAP_EFFECT_DISCARD
= 0,
66 DXGI_SWAP_EFFECT_SEQUENTIAL
= 1,
67 DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL
= 3,
68 DXGI_SWAP_EFFECT_FLIP_DISCARD
= 4
71 typedef enum DXGI_RESIDENCY
{
72 DXGI_RESIDENCY_FULLY_RESIDENT
= 1,
73 DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY
= 2,
74 DXGI_RESIDENCY_EVICTED_TO_DISK
= 3,
77 typedef struct DXGI_SURFACE_DESC
{
81 DXGI_SAMPLE_DESC SampleDesc
;
84 typedef struct DXGI_MAPPED_RECT
{
89 typedef struct DXGI_OUTPUT_DESC
{
91 RECT DesktopCoordinates
;
92 BOOL AttachedToDesktop
;
93 DXGI_MODE_ROTATION Rotation
;
97 typedef struct DXGI_FRAME_STATISTICS
{
99 UINT PresentRefreshCount
;
100 UINT SyncRefreshCount
;
101 LARGE_INTEGER SyncQPCTime
;
102 LARGE_INTEGER SyncGPUTime
;
103 } DXGI_FRAME_STATISTICS
;
105 typedef struct DXGI_ADAPTER_DESC
{
106 WCHAR Description
[128];
111 SIZE_T DedicatedVideoMemory
;
112 SIZE_T DedicatedSystemMemory
;
113 SIZE_T SharedSystemMemory
;
117 typedef enum DXGI_SWAP_CHAIN_FLAG
119 DXGI_SWAP_CHAIN_FLAG_NONPREROTATED
= 0x0001,
120 DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH
= 0x0002,
121 DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE
= 0x0004,
122 DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTEXT
= 0x0008,
123 DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER
= 0x0010,
124 DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY
= 0x0020,
125 DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT
= 0x0040,
126 DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER
= 0x0080,
127 DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO
= 0x0100,
128 DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO
= 0x0200,
129 DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED
= 0x0400,
130 DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING
= 0x0800,
131 DXGI_SWAP_CHAIN_FLAG_RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS
= 0x1000,
132 } DXGI_SWAP_CHAIN_FLAG
;
134 typedef struct DXGI_SWAP_CHAIN_DESC
{
135 DXGI_MODE_DESC BufferDesc
;
136 DXGI_SAMPLE_DESC SampleDesc
;
137 DXGI_USAGE BufferUsage
;
141 DXGI_SWAP_EFFECT SwapEffect
;
143 } DXGI_SWAP_CHAIN_DESC
;
145 typedef struct DXGI_SHARED_RESOURCE
{
147 } DXGI_SHARED_RESOURCE
;
152 uuid(aec22fb8
-76f3
-4639-9be0
-28eb43a67a2e
)
154 interface IDXGIObject
: IUnknown
156 HRESULT SetPrivateData
(
159 [in] const void *data
161 HRESULT SetPrivateDataInterface
(
163 [in] const IUnknown
*object
165 HRESULT GetPrivateData
(
167 [in, out] UINT
*data_size
,
179 uuid(3d3e0379
-f9de
-4d58
-bb6c
-18d62992f1a6
)
181 interface IDXGIDeviceSubObject
: IDXGIObject
191 uuid(035f3ab4
-482e-4e50
-b41f
-8a7f8bd8960b
),
193 pointer_default(unique)
195 interface IDXGIResource
: IDXGIDeviceSubObject
197 HRESULT GetSharedHandle
([out] HANDLE *pSharedHandle
);
198 HRESULT GetUsage
([out] DXGI_USAGE
*pUsage
);
199 HRESULT SetEvictionPriority
([in] UINT EvictionPriority
);
200 HRESULT GetEvictionPriority
([out, retval] UINT
*pEvictionPriority
);
205 uuid(9d8e1289
-d7b3
-465f
-8126-250e349af85d
),
207 pointer_default(unique)
209 interface IDXGIKeyedMutex
: IDXGIDeviceSubObject
211 HRESULT AcquireSync
([in] UINT64 Key
, [in] DWORD dwMilliseconds
);
212 HRESULT ReleaseSync
([in] UINT64 Key
);
218 uuid(cafcb56c
-6ac3
-4889-bf47
-9e23bbd260ec
)
220 interface IDXGISurface
: IDXGIDeviceSubObject
223 [out] DXGI_SURFACE_DESC
*desc
226 [out] DXGI_MAPPED_RECT
*mapped_rect
,
236 uuid(4ae63092
-6327-4c1b
-80ae
-bfe12ea32b86
)
238 interface IDXGISurface1
: IDXGISurface
245 [in] RECT
*dirty_rect
252 uuid(ae02eedb
-c735
-4690-8d52
-5a8dc20213aa
)
254 interface IDXGIOutput
: IDXGIObject
257 [out] DXGI_OUTPUT_DESC
*desc
259 HRESULT GetDisplayModeList
(
260 [in] DXGI_FORMAT format
,
262 [in, out] UINT
*mode_count
,
263 [out] DXGI_MODE_DESC
*desc
265 HRESULT FindClosestMatchingMode
(
266 [in] const DXGI_MODE_DESC
*mode
,
267 [out] DXGI_MODE_DESC
*closest_match
,
268 [in] IUnknown
*device
270 HRESULT WaitForVBlank
(
272 HRESULT TakeOwnership
(
273 [in] IUnknown
*device
,
276 void ReleaseOwnership
(
278 HRESULT GetGammaControlCapabilities
(
279 [out] DXGI_GAMMA_CONTROL_CAPABILITIES
*gamma_caps
281 HRESULT SetGammaControl
(
282 [in] const DXGI_GAMMA_CONTROL
*gamma_control
284 HRESULT GetGammaControl
(
285 [out] DXGI_GAMMA_CONTROL
*gamma_control
287 HRESULT SetDisplaySurface
(
288 [in] IDXGISurface
*surface
290 HRESULT GetDisplaySurfaceData
(
291 [in] IDXGISurface
*surface
293 HRESULT GetFrameStatistics
(
294 [out] DXGI_FRAME_STATISTICS
*stats
301 uuid(2411e7e1
-12ac
-4ccf
-bd14
-9798e8534dc0
)
303 interface IDXGIAdapter
: IDXGIObject
306 [in] UINT output_idx
,
307 [in, out] IDXGIOutput
**output
310 [out] DXGI_ADAPTER_DESC
*desc
312 HRESULT CheckInterfaceSupport
(
314 [out] LARGE_INTEGER
*umd_version
318 cpp_quote
("#define DXGI_MAX_SWAP_CHAIN_BUFFERS (16)")
320 cpp_quote
("#define DXGI_PRESENT_TEST __MSABI_LONG(0x00000001U)")
321 cpp_quote
("#define DXGI_PRESENT_DO_NOT_SEQUENCE __MSABI_LONG(0x00000002U)")
322 cpp_quote
("#define DXGI_PRESENT_RESTART __MSABI_LONG(0x00000004U)")
323 cpp_quote
("#define DXGI_PRESENT_DO_NOT_WAIT __MSABI_LONG(0x00000008U)")
324 cpp_quote
("#define DXGI_PRESENT_STEREO_PREFER_RIGHT __MSABI_LONG(0x00000010U)")
325 cpp_quote
("#define DXGI_PRESENT_STEREO_TEMPORARY_MONO __MSABI_LONG(0x00000020U)")
326 cpp_quote
("#define DXGI_PRESENT_RESTRICT_TO_OUTPUT __MSABI_LONG(0x00000040U)")
327 cpp_quote
("#define DXGI_PRESENT_USE_DURATION __MSABI_LONG(0x00000100U)")
328 cpp_quote
("#define DXGI_PRESENT_ALLOW_TEARING __MSABI_LONG(0x00000200U)")
333 uuid(310d36a0
-d2e7
-4c0a
-aa04
-6a9d23b8886a
)
335 interface IDXGISwapChain
: IDXGIDeviceSubObject
338 [in] UINT sync_interval
,
342 [in] UINT buffer_idx
,
344 [in, out] void **surface
346 HRESULT SetFullscreenState
(
347 [in] BOOL fullscreen
,
348 [in] IDXGIOutput
*target
350 HRESULT GetFullscreenState
(
351 [out] BOOL
*fullscreen
,
352 [out] IDXGIOutput
**target
355 [out] DXGI_SWAP_CHAIN_DESC
*desc
357 HRESULT ResizeBuffers
(
358 [in] UINT buffer_count
,
361 [in] DXGI_FORMAT format
,
364 HRESULT ResizeTarget
(
365 [in] const DXGI_MODE_DESC
*target_mode_desc
367 HRESULT GetContainingOutput
(
368 [out] IDXGIOutput
**output
370 HRESULT GetFrameStatistics
(
371 [out] DXGI_FRAME_STATISTICS
*stats
373 HRESULT GetLastPresentCount
(
374 [out] UINT
*last_present_count
378 cpp_quote
("#define DXGI_MWA_NO_WINDOW_CHANGES 0x1")
379 cpp_quote
("#define DXGI_MWA_NO_ALT_ENTER 0x2")
380 cpp_quote
("#define DXGI_MWA_NO_PRINT_SCREEN 0x4")
381 cpp_quote
("#define DXGI_MWA_VALID 0x7")
386 uuid(7b7166ec
-21c7
-44ae
-b21a
-c9ae321ae369
)
388 interface IDXGIFactory
: IDXGIObject
390 HRESULT EnumAdapters
(
391 [in] UINT adapter_idx
,
392 [out] IDXGIAdapter
**adapter
394 HRESULT MakeWindowAssociation
(
398 HRESULT GetWindowAssociation
(
401 HRESULT CreateSwapChain
(
402 [in] IUnknown
*device
,
403 [in] DXGI_SWAP_CHAIN_DESC
*desc
,
404 [out] IDXGISwapChain
**swapchain
406 HRESULT CreateSoftwareAdapter
(
408 [out] IDXGIAdapter
**adapter
412 [local] HRESULT __stdcall CreateDXGIFactory
(REFIID riid
, void **factory
);
413 [local] HRESULT __stdcall CreateDXGIFactory1
(REFIID riid
, void **factory
);
418 uuid(54ec77fa
-1377-44e6
-8c32
-88fd5f44c84c
)
420 interface IDXGIDevice
: IDXGIObject
423 [out] IDXGIAdapter
**adapter
425 HRESULT CreateSurface
(
426 [in] const DXGI_SURFACE_DESC
*desc
,
427 [in] UINT surface_count
,
428 [in] DXGI_USAGE usage
,
429 [in] const DXGI_SHARED_RESOURCE
*shared_resource
,
430 [out] IDXGISurface
**surface
432 HRESULT QueryResourceResidency
(
433 [in] IUnknown
*const *resources
,
434 [out] DXGI_RESIDENCY
*residency
,
435 [in] UINT resource_count
437 HRESULT SetGPUThreadPriority
(
440 HRESULT GetGPUThreadPriority
(
445 typedef enum DXGI_ADAPTER_FLAG
{
446 DXGI_ADAPTER_FLAG_NONE
= 0,
447 DXGI_ADAPTER_FLAG_REMOTE
= 1,
448 DXGI_ADAPTER_FLAG_SOFTWARE
= 2,
449 DXGI_ADAPTER_FLAG_FORCE_DWORD
= 0xFFFFFFFF
452 typedef struct DXGI_ADAPTER_DESC1
{
453 WCHAR Description
[128];
458 SIZE_T DedicatedVideoMemory
;
459 SIZE_T DedicatedSystemMemory
;
460 SIZE_T SharedSystemMemory
;
463 } DXGI_ADAPTER_DESC1
;
467 uuid(29038f61
-3839-4626-91fd
-086879011a05
),
469 pointer_default(unique)
471 interface IDXGIAdapter1
: IDXGIAdapter
473 HRESULT GetDesc1
([out] DXGI_ADAPTER_DESC1
*pDesc
);
478 uuid(77db970f
-6276-48ba
-ba28
-070143b4392c
),
480 pointer_default(unique)
482 interface IDXGIDevice1
: IDXGIDevice
484 HRESULT SetMaximumFrameLatency
([in] UINT MaxLatency
);
485 HRESULT GetMaximumFrameLatency
([out] UINT
*pMaxLatency
);
490 uuid(770aae78
-f26f
-4dba
-a829
-253c83d1b387
),
492 pointer_default(unique)
494 interface IDXGIFactory1
: IDXGIFactory
496 HRESULT EnumAdapters1
([in] UINT Adapter
, [out] IDXGIAdapter1
**ppAdapter
);