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
19 import "dxgitype.idl";
22 typedef HANDLE HMONITOR;
23 typedef struct _LUID {
29 typedef UINT DXGI_USAGE;
30 const DXGI_USAGE DXGI_USAGE_SHADER_INPUT = 0x10L;
31 const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20L;
32 const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L;
33 const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L;
34 const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L;
36 typedef enum DXGI_SWAP_EFFECT {
37 DXGI_SWAP_EFFECT_DISCARD = 0,
38 DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
41 typedef enum DXGI_RESIDENCY {
42 DXGI_RESIDENCY_FULLY_RESIDENT = 1,
43 DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
44 DXGI_RESIDENCY_EVICTED_TO_DISK = 3,
47 typedef struct DXGI_SURFACE_DESC {
51 DXGI_SAMPLE_DESC SampleDesc;
54 typedef struct DXGI_MAPPED_RECT {
59 typedef struct DXGI_OUTPUT_DESC {
61 RECT DesktopCoordinates;
62 BOOL AttachedToDesktop;
63 DXGI_MODE_ROTATION Rotation;
67 typedef struct DXGI_FRAME_STATISTICS {
69 UINT PresentRefreshCount;
70 UINT SyncRefreshCount;
71 LARGE_INTEGER SyncQPCTime;
72 LARGE_INTEGER SyncGPUTime;
73 } DXGI_FRAME_STATISTICS;
75 typedef struct DXGI_ADAPTER_DESC {
76 WCHAR Description[128];
81 SIZE_T DedicatedVideoMemory;
82 SIZE_T DedicatedSystemMemory;
83 SIZE_T SharedSystemMemory;
87 typedef struct DXGI_SWAP_CHAIN_DESC {
88 DXGI_MODE_DESC BufferDesc;
89 DXGI_SAMPLE_DESC SampleDesc;
90 DXGI_USAGE BufferUsage;
94 DXGI_SWAP_EFFECT SwapEffect;
96 } DXGI_SWAP_CHAIN_DESC;
98 typedef struct DXGI_SHARED_RESOURCE {
100 } DXGI_SHARED_RESOURCE;
105 uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
107 interface IDXGIObject : IUnknown
109 HRESULT SetPrivateData(
112 [in] const void *data
114 HRESULT SetPrivateDataInterface(
116 [in] const IUnknown *object
118 HRESULT GetPrivateData(
120 [in, out] UINT *data_size,
132 uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
134 interface IDXGIDeviceSubObject : IDXGIObject
145 uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
147 interface IDXGISurface : IDXGIDeviceSubObject
150 [out] DXGI_SURFACE_DESC *desc
153 [out] DXGI_MAPPED_RECT *mapped_rect,
163 uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
165 interface IDXGIOutput : IDXGIObject
168 [out] DXGI_OUTPUT_DESC *desc
170 HRESULT GetDisplayModeList(
171 [in] DXGI_FORMAT format,
173 [in, out] UINT *mode_count,
174 [out] DXGI_MODE_DESC *desc
176 HRESULT FindClosestMatchingMode(
177 [in] const DXGI_MODE_DESC *mode,
178 [out] DXGI_MODE_DESC *closest_match,
179 [in] IUnknown *device
181 HRESULT WaitForVBlank(
183 HRESULT TakeOwnership(
184 [in] IUnknown *device,
187 void ReleaseOwnership(
189 HRESULT GetGammaControlCapabilities(
190 [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
192 HRESULT SetGammaControl(
193 [in] const DXGI_GAMMA_CONTROL *gamma_control
195 HRESULT GetGammaControl(
196 [out] DXGI_GAMMA_CONTROL *gamma_control
198 HRESULT SetDisplaySurface(
199 [in] IDXGISurface *surface
201 HRESULT GetDisplaySurfaceData(
202 [in] IDXGISurface *surface
204 HRESULT GetFrameStatistics(
205 [out] DXGI_FRAME_STATISTICS *stats
212 uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
214 interface IDXGIAdapter : IDXGIObject
217 [in] UINT output_idx,
218 [in, out] IDXGIOutput **output
221 [out] DXGI_ADAPTER_DESC *desc
223 HRESULT CheckInterfaceSupport(
225 [out] LARGE_INTEGER *umd_version
232 uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
234 interface IDXGISwapChain : IDXGIDeviceSubObject
237 [in] UINT sync_interval,
241 [in] UINT buffer_idx,
243 [in, out] void **surface
245 HRESULT SetFullscreenState(
246 [in] BOOL fullscreen,
247 [in] IDXGIOutput *target
249 HRESULT GetFullscreenState(
250 [out] BOOL *fullscreen,
251 [out] IDXGIOutput **target
254 [out] DXGI_SWAP_CHAIN_DESC *desc
256 HRESULT ResizeBuffers(
257 [in] UINT buffer_count,
260 [in] DXGI_FORMAT format,
263 HRESULT ResizeTarget(
264 [in] const DXGI_MODE_DESC *target_mode_desc
266 HRESULT GetContainingOutput(
267 [out] IDXGIOutput **output
269 HRESULT GetFrameStatistics(
270 [out] DXGI_FRAME_STATISTICS *stats
272 HRESULT GetLastPresentCount(
273 [out] UINT *last_present_count
280 uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
282 interface IDXGIFactory : IDXGIObject
284 HRESULT EnumAdapters(
285 [in] UINT adapter_idx,
286 [out] IDXGIAdapter **adapter
288 HRESULT MakeWindowAssociation(
292 HRESULT GetWindowAssociation(
295 HRESULT CreateSwapChain(
296 [in] IUnknown *device,
297 [in] DXGI_SWAP_CHAIN_DESC *desc,
298 [out] IDXGISwapChain **swapchain
300 HRESULT CreateSoftwareAdapter(
302 [out] IDXGIAdapter **adapter
306 [local] HRESULT CreateDXGIFactory(REFIID riid, void **factory);
311 uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
313 interface IDXGIDevice : IDXGIObject
316 [out] IDXGIAdapter **adapter
318 HRESULT CreateSurface(
319 [in] const DXGI_SURFACE_DESC *desc,
320 [in] UINT surface_count,
321 [in] DXGI_USAGE usage,
322 [in] const DXGI_SHARED_RESOURCE *shared_resource,
323 [out] IDXGISurface **surface
325 HRESULT QueryResourceResidency(
326 [in] IUnknown *const *resources,
327 [out] DXGI_RESIDENCY *residency,
328 [in] UINT resource_count
330 HRESULT SetGPUThreadPriority(
333 HRESULT GetGPUThreadPriority(