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 typedef UINT DXGI_USAGE
;
37 const DXGI_USAGE DXGI_USAGE_SHADER_INPUT
= 0x10L
;
38 const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT
= 0x20L
;
39 const DXGI_USAGE DXGI_USAGE_BACK_BUFFER
= 0x40L
;
40 const DXGI_USAGE DXGI_USAGE_SHARED
= 0x80L
;
41 const DXGI_USAGE DXGI_USAGE_READ_ONLY
= 0x100L
;
42 const DXGI_USAGE DXGI_USAGE_DISCARD_ON_PRESENT
= 0x200L
;
43 const DXGI_USAGE DXGI_USAGE_UNORDERED_ACCESS
= 0x400L
;
45 const UINT DXGI_ENUM_MODES_INTERLACED
= 1;
46 const UINT DXGI_ENUM_MODES_SCALING
= 2;
48 const UINT DXGI_RESOURCE_PRIORITY_MINIMUM
= 0x28000000;
49 const UINT DXGI_RESOURCE_PRIORITY_LOW
= 0x50000000;
50 const UINT DXGI_RESOURCE_PRIORITY_NORMAL
= 0x78000000;
51 const UINT DXGI_RESOURCE_PRIORITY_HIGH
= 0xa0000000;
52 const UINT DXGI_RESOURCE_PRIORITY_MAXIMUM
= 0xc8000000;
54 const UINT DXGI_MAP_READ
= 0x1;
55 const UINT DXGI_MAP_WRITE
= 0x2;
56 const UINT DXGI_MAP_DISCARD
= 0x4;
58 typedef enum DXGI_SWAP_EFFECT
{
59 DXGI_SWAP_EFFECT_DISCARD
= 0,
60 DXGI_SWAP_EFFECT_SEQUENTIAL
= 1,
61 DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL
= 3,
62 DXGI_SWAP_EFFECT_FLIP_DISCARD
= 4
65 typedef enum DXGI_RESIDENCY
{
66 DXGI_RESIDENCY_FULLY_RESIDENT
= 1,
67 DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY
= 2,
68 DXGI_RESIDENCY_EVICTED_TO_DISK
= 3,
71 typedef struct DXGI_SURFACE_DESC
{
75 DXGI_SAMPLE_DESC SampleDesc
;
78 typedef struct DXGI_MAPPED_RECT
{
83 typedef struct DXGI_OUTPUT_DESC
{
85 RECT DesktopCoordinates
;
86 BOOL AttachedToDesktop
;
87 DXGI_MODE_ROTATION Rotation
;
91 typedef struct DXGI_FRAME_STATISTICS
{
93 UINT PresentRefreshCount
;
94 UINT SyncRefreshCount
;
95 LARGE_INTEGER SyncQPCTime
;
96 LARGE_INTEGER SyncGPUTime
;
97 } DXGI_FRAME_STATISTICS
;
99 typedef struct DXGI_ADAPTER_DESC
{
100 WCHAR Description
[128];
105 SIZE_T DedicatedVideoMemory
;
106 SIZE_T DedicatedSystemMemory
;
107 SIZE_T SharedSystemMemory
;
111 typedef enum DXGI_SWAP_CHAIN_FLAG
{
112 DXGI_SWAP_CHAIN_FLAG_NONPREROTATED
= 1,
113 DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH
= 2,
114 DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE
= 4
115 } DXGI_SWAP_CHAIN_FLAG
;
117 typedef struct DXGI_SWAP_CHAIN_DESC
{
118 DXGI_MODE_DESC BufferDesc
;
119 DXGI_SAMPLE_DESC SampleDesc
;
120 DXGI_USAGE BufferUsage
;
124 DXGI_SWAP_EFFECT SwapEffect
;
126 } DXGI_SWAP_CHAIN_DESC
;
128 typedef struct DXGI_SHARED_RESOURCE
{
130 } DXGI_SHARED_RESOURCE
;
135 uuid(aec22fb8
-76f3
-4639-9be0
-28eb43a67a2e
)
137 interface IDXGIObject
: IUnknown
139 HRESULT SetPrivateData
(
142 [in] const void *data
144 HRESULT SetPrivateDataInterface
(
146 [in] const IUnknown
*object
148 HRESULT GetPrivateData
(
150 [in, out] UINT
*data_size
,
162 uuid(3d3e0379
-f9de
-4d58
-bb6c
-18d62992f1a6
)
164 interface IDXGIDeviceSubObject
: IDXGIObject
174 uuid(035f3ab4
-482e-4e50
-b41f
-8a7f8bd8960b
),
176 pointer_default(unique)
178 interface IDXGIResource
: IDXGIDeviceSubObject
180 HRESULT GetSharedHandle
([out] HANDLE *pSharedHandle
);
181 HRESULT GetUsage
([out] DXGI_USAGE
*pUsage
);
182 HRESULT SetEvictionPriority
([in] UINT EvictionPriority
);
183 HRESULT GetEvictionPriority
([out, retval] UINT
*pEvictionPriority
);
188 uuid(9d8e1289
-d7b3
-465f
-8126-250e349af85d
),
190 pointer_default(unique)
192 interface IDXGIKeyedMutex
: IDXGIDeviceSubObject
194 HRESULT AcquireSync
([in] UINT64 Key
, [in] DWORD dwMilliseconds
);
195 HRESULT ReleaseSync
([in] UINT64 Key
);
201 uuid(cafcb56c
-6ac3
-4889-bf47
-9e23bbd260ec
)
203 interface IDXGISurface
: IDXGIDeviceSubObject
206 [out] DXGI_SURFACE_DESC
*desc
209 [out] DXGI_MAPPED_RECT
*mapped_rect
,
219 uuid(4ae63092
-6327-4c1b
-80ae
-bfe12ea32b86
)
221 interface IDXGISurface1
: IDXGISurface
228 [in] RECT
*dirty_rect
235 uuid(ae02eedb
-c735
-4690-8d52
-5a8dc20213aa
)
237 interface IDXGIOutput
: IDXGIObject
240 [out] DXGI_OUTPUT_DESC
*desc
242 HRESULT GetDisplayModeList
(
243 [in] DXGI_FORMAT format
,
245 [in, out] UINT
*mode_count
,
246 [out] DXGI_MODE_DESC
*desc
248 HRESULT FindClosestMatchingMode
(
249 [in] const DXGI_MODE_DESC
*mode
,
250 [out] DXGI_MODE_DESC
*closest_match
,
251 [in] IUnknown
*device
253 HRESULT WaitForVBlank
(
255 HRESULT TakeOwnership
(
256 [in] IUnknown
*device
,
259 void ReleaseOwnership
(
261 HRESULT GetGammaControlCapabilities
(
262 [out] DXGI_GAMMA_CONTROL_CAPABILITIES
*gamma_caps
264 HRESULT SetGammaControl
(
265 [in] const DXGI_GAMMA_CONTROL
*gamma_control
267 HRESULT GetGammaControl
(
268 [out] DXGI_GAMMA_CONTROL
*gamma_control
270 HRESULT SetDisplaySurface
(
271 [in] IDXGISurface
*surface
273 HRESULT GetDisplaySurfaceData
(
274 [in] IDXGISurface
*surface
276 HRESULT GetFrameStatistics
(
277 [out] DXGI_FRAME_STATISTICS
*stats
284 uuid(2411e7e1
-12ac
-4ccf
-bd14
-9798e8534dc0
)
286 interface IDXGIAdapter
: IDXGIObject
289 [in] UINT output_idx
,
290 [in, out] IDXGIOutput
**output
293 [out] DXGI_ADAPTER_DESC
*desc
295 HRESULT CheckInterfaceSupport
(
297 [out] LARGE_INTEGER
*umd_version
301 cpp_quote
("#define DXGI_MAX_SWAP_CHAIN_BUFFERS (16)")
303 cpp_quote
("#define DXGI_PRESENT_TEST __MSABI_LONG(0x00000001U)")
304 cpp_quote
("#define DXGI_PRESENT_DO_NOT_SEQUENCE __MSABI_LONG(0x00000002U)")
305 cpp_quote
("#define DXGI_PRESENT_RESTART __MSABI_LONG(0x00000004U)")
306 cpp_quote
("#define DXGI_PRESENT_DO_NOT_WAIT __MSABI_LONG(0x00000008U)")
307 cpp_quote
("#define DXGI_PRESENT_STEREO_PREFER_RIGHT __MSABI_LONG(0x00000010U)")
308 cpp_quote
("#define DXGI_PRESENT_STEREO_TEMPORARY_MONO __MSABI_LONG(0x00000020U)")
309 cpp_quote
("#define DXGI_PRESENT_RESTRICT_TO_OUTPUT __MSABI_LONG(0x00000040U)")
310 cpp_quote
("#define DXGI_PRESENT_USE_DURATION __MSABI_LONG(0x00000100U)")
311 cpp_quote
("#define DXGI_PRESENT_ALLOW_TEARING __MSABI_LONG(0x00000200U)")
316 uuid(310d36a0
-d2e7
-4c0a
-aa04
-6a9d23b8886a
)
318 interface IDXGISwapChain
: IDXGIDeviceSubObject
321 [in] UINT sync_interval
,
325 [in] UINT buffer_idx
,
327 [in, out] void **surface
329 HRESULT SetFullscreenState
(
330 [in] BOOL fullscreen
,
331 [in] IDXGIOutput
*target
333 HRESULT GetFullscreenState
(
334 [out] BOOL
*fullscreen
,
335 [out] IDXGIOutput
**target
338 [out] DXGI_SWAP_CHAIN_DESC
*desc
340 HRESULT ResizeBuffers
(
341 [in] UINT buffer_count
,
344 [in] DXGI_FORMAT format
,
347 HRESULT ResizeTarget
(
348 [in] const DXGI_MODE_DESC
*target_mode_desc
350 HRESULT GetContainingOutput
(
351 [out] IDXGIOutput
**output
353 HRESULT GetFrameStatistics
(
354 [out] DXGI_FRAME_STATISTICS
*stats
356 HRESULT GetLastPresentCount
(
357 [out] UINT
*last_present_count
361 cpp_quote
("#define DXGI_MWA_NO_WINDOW_CHANGES 0x1")
362 cpp_quote
("#define DXGI_MWA_NO_ALT_ENTER 0x2")
363 cpp_quote
("#define DXGI_MWA_NO_PRINT_SCREEN 0x4")
364 cpp_quote
("#define DXGI_MWA_VALID 0x7")
369 uuid(7b7166ec
-21c7
-44ae
-b21a
-c9ae321ae369
)
371 interface IDXGIFactory
: IDXGIObject
373 HRESULT EnumAdapters
(
374 [in] UINT adapter_idx
,
375 [out] IDXGIAdapter
**adapter
377 HRESULT MakeWindowAssociation
(
381 HRESULT GetWindowAssociation
(
384 HRESULT CreateSwapChain
(
385 [in] IUnknown
*device
,
386 [in] DXGI_SWAP_CHAIN_DESC
*desc
,
387 [out] IDXGISwapChain
**swapchain
389 HRESULT CreateSoftwareAdapter
(
391 [out] IDXGIAdapter
**adapter
395 [local] HRESULT __stdcall CreateDXGIFactory
(REFIID riid
, void **factory
);
396 [local] HRESULT __stdcall CreateDXGIFactory1
(REFIID riid
, void **factory
);
401 uuid(54ec77fa
-1377-44e6
-8c32
-88fd5f44c84c
)
403 interface IDXGIDevice
: IDXGIObject
406 [out] IDXGIAdapter
**adapter
408 HRESULT CreateSurface
(
409 [in] const DXGI_SURFACE_DESC
*desc
,
410 [in] UINT surface_count
,
411 [in] DXGI_USAGE usage
,
412 [in] const DXGI_SHARED_RESOURCE
*shared_resource
,
413 [out] IDXGISurface
**surface
415 HRESULT QueryResourceResidency
(
416 [in] IUnknown
*const *resources
,
417 [out] DXGI_RESIDENCY
*residency
,
418 [in] UINT resource_count
420 HRESULT SetGPUThreadPriority
(
423 HRESULT GetGPUThreadPriority
(
428 typedef enum DXGI_ADAPTER_FLAG
{
429 DXGI_ADAPTER_FLAG_NONE
= 0,
430 DXGI_ADAPTER_FLAG_REMOTE
= 1,
431 DXGI_ADAPTER_FLAG_FORCE_DWORD
= 0xFFFFFFFF
434 typedef struct DXGI_ADAPTER_DESC1
{
435 WCHAR Description
[128];
440 SIZE_T DedicatedVideoMemory
;
441 SIZE_T DedicatedSystemMemory
;
442 SIZE_T SharedSystemMemory
;
445 } DXGI_ADAPTER_DESC1
;
449 uuid(29038f61
-3839-4626-91fd
-086879011a05
),
451 pointer_default(unique)
453 interface IDXGIAdapter1
: IDXGIAdapter
455 HRESULT GetDesc1
([out] DXGI_ADAPTER_DESC1
*pDesc
);
460 uuid(77db970f
-6276-48ba
-ba28
-070143b4392c
),
462 pointer_default(unique)
464 interface IDXGIDevice1
: IDXGIDevice
466 HRESULT SetMaximumFrameLatency
([in] UINT MaxLatency
);
467 HRESULT GetMaximumFrameLatency
([out] UINT
*pMaxLatency
);
472 uuid(770aae78
-f26f
-4dba
-a829
-253c83d1b387
),
474 pointer_default(unique)
476 interface IDXGIFactory1
: IDXGIFactory
478 HRESULT EnumAdapters1
([in] UINT Adapter
, [out] IDXGIAdapter1
**ppAdapter
);