dmloader: Rewrite IDirectMusicLoader8 ReleaseObject using find_cache_object.
[wine.git] / include / dxgi.idl
blobb724770ab7bd2014a79af6814e8d4ecf6b01976f
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 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
63 } DXGI_SWAP_EFFECT;
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,
69 } DXGI_RESIDENCY;
71 typedef struct DXGI_SURFACE_DESC {
72 UINT Width;
73 UINT Height;
74 DXGI_FORMAT Format;
75 DXGI_SAMPLE_DESC SampleDesc;
76 } DXGI_SURFACE_DESC;
78 typedef struct DXGI_MAPPED_RECT {
79 INT Pitch;
80 BYTE *pBits;
81 } DXGI_MAPPED_RECT;
83 typedef struct DXGI_OUTPUT_DESC {
84 WCHAR DeviceName[32];
85 RECT DesktopCoordinates;
86 BOOL AttachedToDesktop;
87 DXGI_MODE_ROTATION Rotation;
88 HMONITOR Monitor;
89 } DXGI_OUTPUT_DESC;
91 typedef struct DXGI_FRAME_STATISTICS {
92 UINT PresentCount;
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];
101 UINT VendorId;
102 UINT DeviceId;
103 UINT SubSysId;
104 UINT Revision;
105 SIZE_T DedicatedVideoMemory;
106 SIZE_T DedicatedSystemMemory;
107 SIZE_T SharedSystemMemory;
108 LUID AdapterLuid;
109 } DXGI_ADAPTER_DESC;
111 typedef enum DXGI_SWAP_CHAIN_FLAG
113 DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 0x0001,
114 DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 0x0002,
115 DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 0x0004,
116 DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTEXT = 0x0008,
117 DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER = 0x0010,
118 DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY = 0x0020,
119 DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT = 0x0040,
120 DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER = 0x0080,
121 DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO = 0x0100,
122 DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO = 0x0200,
123 DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED = 0x0400,
124 DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING = 0x0800,
125 DXGI_SWAP_CHAIN_FLAG_RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS = 0x1000,
126 } DXGI_SWAP_CHAIN_FLAG;
128 typedef struct DXGI_SWAP_CHAIN_DESC {
129 DXGI_MODE_DESC BufferDesc;
130 DXGI_SAMPLE_DESC SampleDesc;
131 DXGI_USAGE BufferUsage;
132 UINT BufferCount;
133 HWND OutputWindow;
134 BOOL Windowed;
135 DXGI_SWAP_EFFECT SwapEffect;
136 UINT Flags;
137 } DXGI_SWAP_CHAIN_DESC;
139 typedef struct DXGI_SHARED_RESOURCE {
140 HANDLE Handle;
141 } DXGI_SHARED_RESOURCE;
144 object,
145 local,
146 uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
148 interface IDXGIObject : IUnknown
150 HRESULT SetPrivateData(
151 [in] REFGUID guid,
152 [in] UINT data_size,
153 [in] const void *data
155 HRESULT SetPrivateDataInterface(
156 [in] REFGUID guid,
157 [in] const IUnknown *object
159 HRESULT GetPrivateData(
160 [in] REFGUID guid,
161 [in, out] UINT *data_size,
162 [out] void *data
164 HRESULT GetParent(
165 [in] REFIID riid,
166 [out] void **parent
171 object,
172 local,
173 uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
175 interface IDXGIDeviceSubObject : IDXGIObject
177 HRESULT GetDevice(
178 [in] REFIID riid,
179 [out] void **device
184 object,
185 uuid(035f3ab4-482e-4e50-b41f-8a7f8bd8960b),
186 local,
187 pointer_default(unique)
189 interface IDXGIResource : IDXGIDeviceSubObject
191 HRESULT GetSharedHandle([out] HANDLE *pSharedHandle);
192 HRESULT GetUsage([out] DXGI_USAGE *pUsage);
193 HRESULT SetEvictionPriority([in] UINT EvictionPriority);
194 HRESULT GetEvictionPriority([out, retval] UINT *pEvictionPriority);
198 object,
199 uuid(9d8e1289-d7b3-465f-8126-250e349af85d),
200 local,
201 pointer_default(unique)
203 interface IDXGIKeyedMutex : IDXGIDeviceSubObject
205 HRESULT AcquireSync([in] UINT64 Key, [in] DWORD dwMilliseconds);
206 HRESULT ReleaseSync([in] UINT64 Key);
210 object,
211 local,
212 uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
214 interface IDXGISurface : IDXGIDeviceSubObject
216 HRESULT GetDesc(
217 [out] DXGI_SURFACE_DESC *desc
219 HRESULT Map(
220 [out] DXGI_MAPPED_RECT *mapped_rect,
221 [in] UINT flags
223 HRESULT Unmap(
228 object,
229 local,
230 uuid(4ae63092-6327-4c1b-80ae-bfe12ea32b86)
232 interface IDXGISurface1 : IDXGISurface
234 HRESULT GetDC(
235 [in] BOOL discard,
236 [out] HDC *hdc
238 HRESULT ReleaseDC(
239 [in] RECT *dirty_rect
244 object,
245 local,
246 uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
248 interface IDXGIOutput : IDXGIObject
250 HRESULT GetDesc(
251 [out] DXGI_OUTPUT_DESC *desc
253 HRESULT GetDisplayModeList(
254 [in] DXGI_FORMAT format,
255 [in] UINT flags,
256 [in, out] UINT *mode_count,
257 [out] DXGI_MODE_DESC *desc
259 HRESULT FindClosestMatchingMode(
260 [in] const DXGI_MODE_DESC *mode,
261 [out] DXGI_MODE_DESC *closest_match,
262 [in] IUnknown *device
264 HRESULT WaitForVBlank(
266 HRESULT TakeOwnership(
267 [in] IUnknown *device,
268 [in] BOOL exclusive
270 void ReleaseOwnership(
272 HRESULT GetGammaControlCapabilities(
273 [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
275 HRESULT SetGammaControl(
276 [in] const DXGI_GAMMA_CONTROL *gamma_control
278 HRESULT GetGammaControl(
279 [out] DXGI_GAMMA_CONTROL *gamma_control
281 HRESULT SetDisplaySurface(
282 [in] IDXGISurface *surface
284 HRESULT GetDisplaySurfaceData(
285 [in] IDXGISurface *surface
287 HRESULT GetFrameStatistics(
288 [out] DXGI_FRAME_STATISTICS *stats
293 object,
294 local,
295 uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
297 interface IDXGIAdapter : IDXGIObject
299 HRESULT EnumOutputs(
300 [in] UINT output_idx,
301 [in, out] IDXGIOutput **output
303 HRESULT GetDesc(
304 [out] DXGI_ADAPTER_DESC *desc
306 HRESULT CheckInterfaceSupport(
307 [in] REFGUID guid,
308 [out] LARGE_INTEGER *umd_version
312 cpp_quote("#define DXGI_MAX_SWAP_CHAIN_BUFFERS (16)")
314 cpp_quote("#define DXGI_PRESENT_TEST __MSABI_LONG(0x00000001U)")
315 cpp_quote("#define DXGI_PRESENT_DO_NOT_SEQUENCE __MSABI_LONG(0x00000002U)")
316 cpp_quote("#define DXGI_PRESENT_RESTART __MSABI_LONG(0x00000004U)")
317 cpp_quote("#define DXGI_PRESENT_DO_NOT_WAIT __MSABI_LONG(0x00000008U)")
318 cpp_quote("#define DXGI_PRESENT_STEREO_PREFER_RIGHT __MSABI_LONG(0x00000010U)")
319 cpp_quote("#define DXGI_PRESENT_STEREO_TEMPORARY_MONO __MSABI_LONG(0x00000020U)")
320 cpp_quote("#define DXGI_PRESENT_RESTRICT_TO_OUTPUT __MSABI_LONG(0x00000040U)")
321 cpp_quote("#define DXGI_PRESENT_USE_DURATION __MSABI_LONG(0x00000100U)")
322 cpp_quote("#define DXGI_PRESENT_ALLOW_TEARING __MSABI_LONG(0x00000200U)")
325 object,
326 local,
327 uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
329 interface IDXGISwapChain : IDXGIDeviceSubObject
331 HRESULT Present(
332 [in] UINT sync_interval,
333 [in] UINT flags
335 HRESULT GetBuffer(
336 [in] UINT buffer_idx,
337 [in] REFIID riid,
338 [in, out] void **surface
340 HRESULT SetFullscreenState(
341 [in] BOOL fullscreen,
342 [in] IDXGIOutput *target
344 HRESULT GetFullscreenState(
345 [out] BOOL *fullscreen,
346 [out] IDXGIOutput **target
348 HRESULT GetDesc(
349 [out] DXGI_SWAP_CHAIN_DESC *desc
351 HRESULT ResizeBuffers(
352 [in] UINT buffer_count,
353 [in] UINT width,
354 [in] UINT height,
355 [in] DXGI_FORMAT format,
356 [in] UINT flags
358 HRESULT ResizeTarget(
359 [in] const DXGI_MODE_DESC *target_mode_desc
361 HRESULT GetContainingOutput(
362 [out] IDXGIOutput **output
364 HRESULT GetFrameStatistics(
365 [out] DXGI_FRAME_STATISTICS *stats
367 HRESULT GetLastPresentCount(
368 [out] UINT *last_present_count
372 cpp_quote("#define DXGI_MWA_NO_WINDOW_CHANGES 0x1")
373 cpp_quote("#define DXGI_MWA_NO_ALT_ENTER 0x2")
374 cpp_quote("#define DXGI_MWA_NO_PRINT_SCREEN 0x4")
375 cpp_quote("#define DXGI_MWA_VALID 0x7")
378 object,
379 local,
380 uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
382 interface IDXGIFactory : IDXGIObject
384 HRESULT EnumAdapters(
385 [in] UINT adapter_idx,
386 [out] IDXGIAdapter **adapter
388 HRESULT MakeWindowAssociation(
389 [in] HWND window,
390 [in] UINT flags
392 HRESULT GetWindowAssociation(
393 [in] HWND *window
395 HRESULT CreateSwapChain(
396 [in] IUnknown *device,
397 [in] DXGI_SWAP_CHAIN_DESC *desc,
398 [out] IDXGISwapChain **swapchain
400 HRESULT CreateSoftwareAdapter(
401 [in] HMODULE swrast,
402 [out] IDXGIAdapter **adapter
406 [local] HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **factory);
407 [local] HRESULT __stdcall CreateDXGIFactory1(REFIID riid, void **factory);
410 object,
411 local,
412 uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
414 interface IDXGIDevice : IDXGIObject
416 HRESULT GetAdapter(
417 [out] IDXGIAdapter **adapter
419 HRESULT CreateSurface(
420 [in] const DXGI_SURFACE_DESC *desc,
421 [in] UINT surface_count,
422 [in] DXGI_USAGE usage,
423 [in] const DXGI_SHARED_RESOURCE *shared_resource,
424 [out] IDXGISurface **surface
426 HRESULT QueryResourceResidency(
427 [in] IUnknown *const *resources,
428 [out] DXGI_RESIDENCY *residency,
429 [in] UINT resource_count
431 HRESULT SetGPUThreadPriority(
432 [in] INT priority
434 HRESULT GetGPUThreadPriority(
435 [out] INT *priority
439 typedef enum DXGI_ADAPTER_FLAG {
440 DXGI_ADAPTER_FLAG_NONE = 0,
441 DXGI_ADAPTER_FLAG_REMOTE = 1,
442 DXGI_ADAPTER_FLAG_FORCE_DWORD = 0xFFFFFFFF
443 } DXGI_ADAPTER_FLAG;
445 typedef struct DXGI_ADAPTER_DESC1 {
446 WCHAR Description[128];
447 UINT VendorId;
448 UINT DeviceId;
449 UINT SubSysId;
450 UINT Revision;
451 SIZE_T DedicatedVideoMemory;
452 SIZE_T DedicatedSystemMemory;
453 SIZE_T SharedSystemMemory;
454 LUID AdapterLuid;
455 UINT Flags;
456 } DXGI_ADAPTER_DESC1;
459 object,
460 uuid(29038f61-3839-4626-91fd-086879011a05),
461 local,
462 pointer_default(unique)
464 interface IDXGIAdapter1 : IDXGIAdapter
466 HRESULT GetDesc1([out] DXGI_ADAPTER_DESC1 *pDesc);
470 object,
471 uuid(77db970f-6276-48ba-ba28-070143b4392c),
472 local,
473 pointer_default(unique)
475 interface IDXGIDevice1 : IDXGIDevice
477 HRESULT SetMaximumFrameLatency([in] UINT MaxLatency);
478 HRESULT GetMaximumFrameLatency([out] UINT *pMaxLatency);
482 object,
483 uuid(770aae78-f26f-4dba-a829-253c83d1b387),
484 local,
485 pointer_default(unique)
487 interface IDXGIFactory1 : IDXGIFactory
489 HRESULT EnumAdapters1([in] UINT Adapter, [out] IDXGIAdapter1 **ppAdapter);
490 BOOL IsCurrent();