ole32: Use generic class factory for pointer moniker.
[wine.git] / include / dxgi.idl
blobb35c8911889bf075c1bc4aa69ff78efe76cc6fb3
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.h";
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 typedef enum DXGI_SWAP_EFFECT {
49 DXGI_SWAP_EFFECT_DISCARD = 0,
50 DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
51 DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL = 3,
52 DXGI_SWAP_EFFECT_FLIP_DISCARD = 4
53 } DXGI_SWAP_EFFECT;
55 typedef enum DXGI_RESIDENCY {
56 DXGI_RESIDENCY_FULLY_RESIDENT = 1,
57 DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
58 DXGI_RESIDENCY_EVICTED_TO_DISK = 3,
59 } DXGI_RESIDENCY;
61 typedef struct DXGI_SURFACE_DESC {
62 UINT Width;
63 UINT Height;
64 DXGI_FORMAT Format;
65 DXGI_SAMPLE_DESC SampleDesc;
66 } DXGI_SURFACE_DESC;
68 typedef struct DXGI_MAPPED_RECT {
69 INT Pitch;
70 BYTE *pBits;
71 } DXGI_MAPPED_RECT;
73 typedef struct DXGI_OUTPUT_DESC {
74 WCHAR DeviceName[32];
75 RECT DesktopCoordinates;
76 BOOL AttachedToDesktop;
77 DXGI_MODE_ROTATION Rotation;
78 HMONITOR Monitor;
79 } DXGI_OUTPUT_DESC;
81 typedef struct DXGI_FRAME_STATISTICS {
82 UINT PresentCount;
83 UINT PresentRefreshCount;
84 UINT SyncRefreshCount;
85 LARGE_INTEGER SyncQPCTime;
86 LARGE_INTEGER SyncGPUTime;
87 } DXGI_FRAME_STATISTICS;
89 typedef struct DXGI_ADAPTER_DESC {
90 WCHAR Description[128];
91 UINT VendorId;
92 UINT DeviceId;
93 UINT SubSysId;
94 UINT Revision;
95 SIZE_T DedicatedVideoMemory;
96 SIZE_T DedicatedSystemMemory;
97 SIZE_T SharedSystemMemory;
98 LUID AdapterLuid;
99 } DXGI_ADAPTER_DESC;
101 typedef enum DXGI_SWAP_CHAIN_FLAG {
102 DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1,
103 DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2,
104 DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 4
105 } DXGI_SWAP_CHAIN_FLAG;
107 typedef struct DXGI_SWAP_CHAIN_DESC {
108 DXGI_MODE_DESC BufferDesc;
109 DXGI_SAMPLE_DESC SampleDesc;
110 DXGI_USAGE BufferUsage;
111 UINT BufferCount;
112 HWND OutputWindow;
113 BOOL Windowed;
114 DXGI_SWAP_EFFECT SwapEffect;
115 UINT Flags;
116 } DXGI_SWAP_CHAIN_DESC;
118 typedef struct DXGI_SHARED_RESOURCE {
119 HANDLE Handle;
120 } DXGI_SHARED_RESOURCE;
123 object,
124 local,
125 uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
127 interface IDXGIObject : IUnknown
129 HRESULT SetPrivateData(
130 [in] REFGUID guid,
131 [in] UINT data_size,
132 [in] const void *data
134 HRESULT SetPrivateDataInterface(
135 [in] REFGUID guid,
136 [in] const IUnknown *object
138 HRESULT GetPrivateData(
139 [in] REFGUID guid,
140 [in, out] UINT *data_size,
141 [out] void *data
143 HRESULT GetParent(
144 [in] REFIID riid,
145 [out] void **parent
150 object,
151 local,
152 uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
154 interface IDXGIDeviceSubObject : IDXGIObject
156 HRESULT GetDevice(
157 [in] REFIID riid,
158 [out] void **device
163 object,
164 uuid(035f3ab4-482e-4e50-b41f-8a7f8bd8960b),
165 local,
166 pointer_default(unique)
168 interface IDXGIResource : IDXGIDeviceSubObject
170 HRESULT GetSharedHandle([out] HANDLE *pSharedHandle);
171 HRESULT GetUsage([out] DXGI_USAGE *pUsage);
172 HRESULT SetEvictionPriority([in] UINT EvictionPriority);
173 HRESULT GetEvictionPriority([out, retval] UINT *pEvictionPriority);
177 object,
178 uuid(9d8e1289-d7b3-465f-8126-250e349af85d),
179 local,
180 pointer_default(unique)
182 interface IDXGIKeyedMutex : IDXGIDeviceSubObject
184 HRESULT AcquireSync([in] UINT64 Key, [in] DWORD dwMilliseconds);
185 HRESULT ReleaseSync([in] UINT64 Key);
189 object,
190 local,
191 uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
193 interface IDXGISurface : IDXGIDeviceSubObject
195 HRESULT GetDesc(
196 [out] DXGI_SURFACE_DESC *desc
198 HRESULT Map(
199 [out] DXGI_MAPPED_RECT *mapped_rect,
200 [in] UINT flags
202 HRESULT Unmap(
207 object,
208 local,
209 uuid(4ae63092-6327-4c1b-80ae-bfe12ea32b86)
211 interface IDXGISurface1 : IDXGISurface
213 HRESULT GetDC(
214 [in] BOOL discard,
215 [out] HDC *hdc
217 HRESULT ReleaseDC(
218 [in] RECT *dirty_rect
223 object,
224 local,
225 uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
227 interface IDXGIOutput : IDXGIObject
229 HRESULT GetDesc(
230 [out] DXGI_OUTPUT_DESC *desc
232 HRESULT GetDisplayModeList(
233 [in] DXGI_FORMAT format,
234 [in] UINT flags,
235 [in, out] UINT *mode_count,
236 [out] DXGI_MODE_DESC *desc
238 HRESULT FindClosestMatchingMode(
239 [in] const DXGI_MODE_DESC *mode,
240 [out] DXGI_MODE_DESC *closest_match,
241 [in] IUnknown *device
243 HRESULT WaitForVBlank(
245 HRESULT TakeOwnership(
246 [in] IUnknown *device,
247 [in] BOOL exclusive
249 void ReleaseOwnership(
251 HRESULT GetGammaControlCapabilities(
252 [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
254 HRESULT SetGammaControl(
255 [in] const DXGI_GAMMA_CONTROL *gamma_control
257 HRESULT GetGammaControl(
258 [out] DXGI_GAMMA_CONTROL *gamma_control
260 HRESULT SetDisplaySurface(
261 [in] IDXGISurface *surface
263 HRESULT GetDisplaySurfaceData(
264 [in] IDXGISurface *surface
266 HRESULT GetFrameStatistics(
267 [out] DXGI_FRAME_STATISTICS *stats
272 object,
273 local,
274 uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
276 interface IDXGIAdapter : IDXGIObject
278 HRESULT EnumOutputs(
279 [in] UINT output_idx,
280 [in, out] IDXGIOutput **output
282 HRESULT GetDesc(
283 [out] DXGI_ADAPTER_DESC *desc
285 HRESULT CheckInterfaceSupport(
286 [in] REFGUID guid,
287 [out] LARGE_INTEGER *umd_version
291 cpp_quote("#define DXGI_MAX_SWAP_CHAIN_BUFFERS (16)")
293 cpp_quote("#define DXGI_PRESENT_TEST __MSABI_LONG(0x00000001U)")
294 cpp_quote("#define DXGI_PRESENT_DO_NOT_SEQUENCE __MSABI_LONG(0x00000002U)")
295 cpp_quote("#define DXGI_PRESENT_RESTART __MSABI_LONG(0x00000004U)")
296 cpp_quote("#define DXGI_PRESENT_DO_NOT_WAIT __MSABI_LONG(0x00000008U)")
297 cpp_quote("#define DXGI_PRESENT_STEREO_PREFER_RIGHT __MSABI_LONG(0x00000010U)")
298 cpp_quote("#define DXGI_PRESENT_STEREO_TEMPORARY_MONO __MSABI_LONG(0x00000020U)")
299 cpp_quote("#define DXGI_PRESENT_RESTRICT_TO_OUTPUT __MSABI_LONG(0x00000040U)")
302 object,
303 local,
304 uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
306 interface IDXGISwapChain : IDXGIDeviceSubObject
308 HRESULT Present(
309 [in] UINT sync_interval,
310 [in] UINT flags
312 HRESULT GetBuffer(
313 [in] UINT buffer_idx,
314 [in] REFIID riid,
315 [in, out] void **surface
317 HRESULT SetFullscreenState(
318 [in] BOOL fullscreen,
319 [in] IDXGIOutput *target
321 HRESULT GetFullscreenState(
322 [out] BOOL *fullscreen,
323 [out] IDXGIOutput **target
325 HRESULT GetDesc(
326 [out] DXGI_SWAP_CHAIN_DESC *desc
328 HRESULT ResizeBuffers(
329 [in] UINT buffer_count,
330 [in] UINT width,
331 [in] UINT height,
332 [in] DXGI_FORMAT format,
333 [in] UINT flags
335 HRESULT ResizeTarget(
336 [in] const DXGI_MODE_DESC *target_mode_desc
338 HRESULT GetContainingOutput(
339 [out] IDXGIOutput **output
341 HRESULT GetFrameStatistics(
342 [out] DXGI_FRAME_STATISTICS *stats
344 HRESULT GetLastPresentCount(
345 [out] UINT *last_present_count
349 cpp_quote("#define DXGI_MWA_NO_WINDOW_CHANGES 0x1")
350 cpp_quote("#define DXGI_MWA_NO_ALT_ENTER 0x2")
351 cpp_quote("#define DXGI_MWA_NO_PRINT_SCREEN 0x4")
352 cpp_quote("#define DXGI_MWA_VALID 0x7")
355 object,
356 local,
357 uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
359 interface IDXGIFactory : IDXGIObject
361 HRESULT EnumAdapters(
362 [in] UINT adapter_idx,
363 [out] IDXGIAdapter **adapter
365 HRESULT MakeWindowAssociation(
366 [in] HWND window,
367 [in] UINT flags
369 HRESULT GetWindowAssociation(
370 [in] HWND *window
372 HRESULT CreateSwapChain(
373 [in] IUnknown *device,
374 [in] DXGI_SWAP_CHAIN_DESC *desc,
375 [out] IDXGISwapChain **swapchain
377 HRESULT CreateSoftwareAdapter(
378 [in] HMODULE swrast,
379 [out] IDXGIAdapter **adapter
383 [local] HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **factory);
384 [local] HRESULT __stdcall CreateDXGIFactory1(REFIID riid, void **factory);
387 object,
388 local,
389 uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
391 interface IDXGIDevice : IDXGIObject
393 HRESULT GetAdapter(
394 [out] IDXGIAdapter **adapter
396 HRESULT CreateSurface(
397 [in] const DXGI_SURFACE_DESC *desc,
398 [in] UINT surface_count,
399 [in] DXGI_USAGE usage,
400 [in] const DXGI_SHARED_RESOURCE *shared_resource,
401 [out] IDXGISurface **surface
403 HRESULT QueryResourceResidency(
404 [in] IUnknown *const *resources,
405 [out] DXGI_RESIDENCY *residency,
406 [in] UINT resource_count
408 HRESULT SetGPUThreadPriority(
409 [in] INT priority
411 HRESULT GetGPUThreadPriority(
412 [out] INT *priority
416 typedef enum DXGI_ADAPTER_FLAG {
417 DXGI_ADAPTER_FLAG_NONE = 0,
418 DXGI_ADAPTER_FLAG_REMOTE = 1,
419 DXGI_ADAPTER_FLAG_FORCE_DWORD = 0xFFFFFFFF
420 } DXGI_ADAPTER_FLAG;
422 typedef struct DXGI_ADAPTER_DESC1 {
423 WCHAR Description[128];
424 UINT VendorId;
425 UINT DeviceId;
426 UINT SubSysId;
427 UINT Revision;
428 SIZE_T DedicatedVideoMemory;
429 SIZE_T DedicatedSystemMemory;
430 SIZE_T SharedSystemMemory;
431 LUID AdapterLuid;
432 UINT Flags;
433 } DXGI_ADAPTER_DESC1;
436 object,
437 uuid(29038f61-3839-4626-91fd-086879011a05),
438 local,
439 pointer_default(unique)
441 interface IDXGIAdapter1 : IDXGIAdapter
443 HRESULT GetDesc1([out] DXGI_ADAPTER_DESC1 *pDesc);
447 object,
448 uuid(77db970f-6276-48ba-ba28-070143b4392c),
449 local,
450 pointer_default(unique)
452 interface IDXGIDevice1 : IDXGIDevice
454 HRESULT SetMaximumFrameLatency([in] UINT MaxLatency);
455 HRESULT GetMaximumFrameLatency([out] UINT *pMaxLatency);
459 object,
460 uuid(770aae78-f26f-4dba-a829-253c83d1b387),
461 local,
462 pointer_default(unique)
464 interface IDXGIFactory1 : IDXGIFactory
466 HRESULT EnumAdapters1([in] UINT Adapter, [out] IDXGIAdapter1 **ppAdapter);
467 BOOL IsCurrent();