server: Allow volume information queries to be asynchronous.
[wine/zf.git] / include / dxgi.idl
blob65c5a4b9d4942a6e3b8a074b6cf0f0996678d252
1 /*
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 "oaidl.idl";
20 import "ocidl.idl";
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)")
28 cpp_quote("#if 0")
29 typedef HANDLE HMONITOR;
30 typedef struct _LUID {
31 DWORD LowPart;
32 LONG HighPart;
33 } LUID, *PLUID;
34 cpp_quote("#endif")
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
69 } DXGI_SWAP_EFFECT;
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,
75 } DXGI_RESIDENCY;
77 typedef struct DXGI_SURFACE_DESC {
78 UINT Width;
79 UINT Height;
80 DXGI_FORMAT Format;
81 DXGI_SAMPLE_DESC SampleDesc;
82 } DXGI_SURFACE_DESC;
84 typedef struct DXGI_MAPPED_RECT {
85 INT Pitch;
86 BYTE *pBits;
87 } DXGI_MAPPED_RECT;
89 typedef struct DXGI_OUTPUT_DESC {
90 WCHAR DeviceName[32];
91 RECT DesktopCoordinates;
92 BOOL AttachedToDesktop;
93 DXGI_MODE_ROTATION Rotation;
94 HMONITOR Monitor;
95 } DXGI_OUTPUT_DESC;
97 typedef struct DXGI_FRAME_STATISTICS {
98 UINT PresentCount;
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];
107 UINT VendorId;
108 UINT DeviceId;
109 UINT SubSysId;
110 UINT Revision;
111 SIZE_T DedicatedVideoMemory;
112 SIZE_T DedicatedSystemMemory;
113 SIZE_T SharedSystemMemory;
114 LUID AdapterLuid;
115 } DXGI_ADAPTER_DESC;
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_CONTENT = 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;
138 UINT BufferCount;
139 HWND OutputWindow;
140 BOOL Windowed;
141 DXGI_SWAP_EFFECT SwapEffect;
142 UINT Flags;
143 } DXGI_SWAP_CHAIN_DESC;
145 typedef struct DXGI_SHARED_RESOURCE {
146 HANDLE Handle;
147 } DXGI_SHARED_RESOURCE;
150 object,
151 local,
152 uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
154 interface IDXGIObject : IUnknown
156 HRESULT SetPrivateData(
157 [in] REFGUID guid,
158 [in] UINT data_size,
159 [in] const void *data
161 HRESULT SetPrivateDataInterface(
162 [in] REFGUID guid,
163 [in] const IUnknown *object
165 HRESULT GetPrivateData(
166 [in] REFGUID guid,
167 [in, out] UINT *data_size,
168 [out] void *data
170 HRESULT GetParent(
171 [in] REFIID riid,
172 [out] void **parent
177 object,
178 local,
179 uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
181 interface IDXGIDeviceSubObject : IDXGIObject
183 HRESULT GetDevice(
184 [in] REFIID riid,
185 [out] void **device
190 object,
191 uuid(035f3ab4-482e-4e50-b41f-8a7f8bd8960b),
192 local,
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);
204 object,
205 uuid(9d8e1289-d7b3-465f-8126-250e349af85d),
206 local,
207 pointer_default(unique)
209 interface IDXGIKeyedMutex : IDXGIDeviceSubObject
211 HRESULT AcquireSync([in] UINT64 Key, [in] DWORD dwMilliseconds);
212 HRESULT ReleaseSync([in] UINT64 Key);
216 object,
217 local,
218 uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
220 interface IDXGISurface : IDXGIDeviceSubObject
222 HRESULT GetDesc(
223 [out] DXGI_SURFACE_DESC *desc
225 HRESULT Map(
226 [out] DXGI_MAPPED_RECT *mapped_rect,
227 [in] UINT flags
229 HRESULT Unmap(
234 object,
235 local,
236 uuid(4ae63092-6327-4c1b-80ae-bfe12ea32b86)
238 interface IDXGISurface1 : IDXGISurface
240 HRESULT GetDC(
241 [in] BOOL discard,
242 [out] HDC *hdc
244 HRESULT ReleaseDC(
245 [in] RECT *dirty_rect
250 object,
251 local,
252 uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
254 interface IDXGIOutput : IDXGIObject
256 HRESULT GetDesc(
257 [out] DXGI_OUTPUT_DESC *desc
259 HRESULT GetDisplayModeList(
260 [in] DXGI_FORMAT format,
261 [in] UINT flags,
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,
274 [in] BOOL exclusive
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
299 object,
300 local,
301 uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
303 interface IDXGIAdapter : IDXGIObject
305 HRESULT EnumOutputs(
306 [in] UINT output_idx,
307 [in, out] IDXGIOutput **output
309 HRESULT GetDesc(
310 [out] DXGI_ADAPTER_DESC *desc
312 HRESULT CheckInterfaceSupport(
313 [in] REFGUID guid,
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)")
331 object,
332 local,
333 uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
335 interface IDXGISwapChain : IDXGIDeviceSubObject
337 HRESULT Present(
338 [in] UINT sync_interval,
339 [in] UINT flags
341 HRESULT GetBuffer(
342 [in] UINT buffer_idx,
343 [in] REFIID riid,
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
354 HRESULT GetDesc(
355 [out] DXGI_SWAP_CHAIN_DESC *desc
357 HRESULT ResizeBuffers(
358 [in] UINT buffer_count,
359 [in] UINT width,
360 [in] UINT height,
361 [in] DXGI_FORMAT format,
362 [in] UINT flags
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")
384 object,
385 local,
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(
395 [in] HWND window,
396 [in] UINT flags
398 HRESULT GetWindowAssociation(
399 [in] HWND *window
401 HRESULT CreateSwapChain(
402 [in] IUnknown *device,
403 [in] DXGI_SWAP_CHAIN_DESC *desc,
404 [out] IDXGISwapChain **swapchain
406 HRESULT CreateSoftwareAdapter(
407 [in] HMODULE swrast,
408 [out] IDXGIAdapter **adapter
412 [local] HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **factory);
413 [local] HRESULT __stdcall CreateDXGIFactory1(REFIID riid, void **factory);
416 object,
417 local,
418 uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
420 interface IDXGIDevice : IDXGIObject
422 HRESULT GetAdapter(
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(
438 [in] INT priority
440 HRESULT GetGPUThreadPriority(
441 [out] INT *priority
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
450 } DXGI_ADAPTER_FLAG;
452 typedef struct DXGI_ADAPTER_DESC1 {
453 WCHAR Description[128];
454 UINT VendorId;
455 UINT DeviceId;
456 UINT SubSysId;
457 UINT Revision;
458 SIZE_T DedicatedVideoMemory;
459 SIZE_T DedicatedSystemMemory;
460 SIZE_T SharedSystemMemory;
461 LUID AdapterLuid;
462 UINT Flags;
463 } DXGI_ADAPTER_DESC1;
465 typedef struct DXGI_DISPLAY_COLOR_SPACE {
466 FLOAT PrimaryCoordinates[8][2];
467 FLOAT WhitePoints[16][2];
468 } DXGI_DISPLAY_COLOR_SPACE;
471 object,
472 uuid(29038f61-3839-4626-91fd-086879011a05),
473 local,
474 pointer_default(unique)
476 interface IDXGIAdapter1 : IDXGIAdapter
478 HRESULT GetDesc1([out] DXGI_ADAPTER_DESC1 *pDesc);
482 object,
483 uuid(77db970f-6276-48ba-ba28-070143b4392c),
484 local,
485 pointer_default(unique)
487 interface IDXGIDevice1 : IDXGIDevice
489 HRESULT SetMaximumFrameLatency([in] UINT MaxLatency);
490 HRESULT GetMaximumFrameLatency([out] UINT *pMaxLatency);
494 object,
495 uuid(770aae78-f26f-4dba-a829-253c83d1b387),
496 local,
497 pointer_default(unique)
499 interface IDXGIFactory1 : IDXGIFactory
501 HRESULT EnumAdapters1([in] UINT Adapter, [out] IDXGIAdapter1 **ppAdapter);
502 BOOL IsCurrent();