quartz: Sign-compare warnings fix.
[wine/wine64.git] / include / dxgi.idl
blob1f0c25e7a521ba0202188d84c728c66b331d931e
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 "dxgitype.idl";
21 cpp_quote("#if 0")
22 typedef HANDLE HMONITOR;
23 typedef struct _LUID {
24 DWORD LowPart;
25 LONG HighPart;
26 } LUID, *PLUID;
27 cpp_quote("#endif")
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,
39 } DXGI_SWAP_EFFECT;
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,
45 } DXGI_RESIDENCY;
47 typedef struct DXGI_SURFACE_DESC {
48 UINT Width;
49 UINT Height;
50 DXGI_FORMAT Format;
51 DXGI_SAMPLE_DESC SampleDesc;
52 } DXGI_SURFACE_DESC;
54 typedef struct DXGI_MAPPED_RECT {
55 INT Pitch;
56 BYTE *pBits;
57 } DXGI_MAPPED_RECT;
59 typedef struct DXGI_OUTPUT_DESC {
60 WCHAR DeviceName[32];
61 RECT DesktopCoordinates;
62 BOOL AttachedToDesktop;
63 DXGI_MODE_ROTATION Rotation;
64 HMONITOR Monitor;
65 } DXGI_OUTPUT_DESC;
67 typedef struct DXGI_FRAME_STATISTICS {
68 UINT PresentCount;
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];
77 UINT VendorId;
78 UINT DeviceId;
79 UINT SubSysId;
80 UINT Revision;
81 SIZE_T DedicatedVideoMemory;
82 SIZE_T DedicatedSystemMemory;
83 SIZE_T SharedSystemMemory;
84 LUID AdapterLuid;
85 } DXGI_ADAPTER_DESC;
87 typedef struct DXGI_SWAP_CHAIN_DESC {
88 DXGI_MODE_DESC BufferDesc;
89 DXGI_SAMPLE_DESC SampleDesc;
90 DXGI_USAGE BufferUsage;
91 UINT BufferCount;
92 HWND OutputWindow;
93 BOOL Windowed;
94 DXGI_SWAP_EFFECT SwapEffect;
95 UINT Flags;
96 } DXGI_SWAP_CHAIN_DESC;
98 typedef struct DXGI_SHARED_RESOURCE {
99 HANDLE Handle;
100 } DXGI_SHARED_RESOURCE;
103 object,
104 local,
105 uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
107 interface IDXGIObject : IUnknown
109 HRESULT SetPrivateData(
110 [in] REFGUID guid,
111 [in] UINT data_size,
112 [in] const void *data
114 HRESULT SetPrivateDataInterface(
115 [in] REFGUID guid,
116 [in] const IUnknown *object
118 HRESULT GetPrivateData(
119 [in] REFGUID guid,
120 [in, out] UINT *data_size,
121 [out] void *data
123 HRESULT GetParent(
124 [in] REFIID riid,
125 [out] void **parent
130 object,
131 local,
132 uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
134 interface IDXGIDeviceSubObject : IDXGIObject
136 HRESULT GetDevice(
137 [in] REFIID riid,
138 [out] void **device
143 object,
144 local,
145 uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
147 interface IDXGISurface : IDXGIDeviceSubObject
149 HRESULT GetDesc(
150 [out] DXGI_SURFACE_DESC *desc
152 HRESULT Map(
153 [out] DXGI_MAPPED_RECT *mapped_rect,
154 [in] UINT flags
156 HRESULT Unmap(
161 object,
162 local,
163 uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
165 interface IDXGIOutput : IDXGIObject
167 HRESULT GetDesc(
168 [out] DXGI_OUTPUT_DESC *desc
170 HRESULT GetDisplayModeList(
171 [in] DXGI_FORMAT format,
172 [in] UINT flags,
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,
185 [in] BOOL exclusive
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
210 object,
211 local,
212 uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
214 interface IDXGIAdapter : IDXGIObject
216 HRESULT EnumOutputs(
217 [in] UINT output_idx,
218 [in, out] IDXGIOutput **output
220 HRESULT GetDesc(
221 [out] DXGI_ADAPTER_DESC *desc
223 HRESULT CheckInterfaceSupport(
224 [in] REFGUID guid,
225 [out] LARGE_INTEGER *umd_version
230 object,
231 local,
232 uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
234 interface IDXGISwapChain : IDXGIDeviceSubObject
236 HRESULT Present(
237 [in] UINT sync_interval,
238 [in] UINT flags
240 HRESULT GetBuffer(
241 [in] UINT buffer_idx,
242 [in] REFIID riid,
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
253 HRESULT GetDesc(
254 [out] DXGI_SWAP_CHAIN_DESC *desc
256 HRESULT ResizeBuffers(
257 [in] UINT buffer_count,
258 [in] UINT width,
259 [in] UINT height,
260 [in] DXGI_FORMAT format,
261 [in] UINT flags
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
278 object,
279 local,
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(
289 [in] HWND window,
290 [in] UINT flags
292 HRESULT GetWindowAssociation(
293 [in] HWND *window
295 HRESULT CreateSwapChain(
296 [in] IUnknown *device,
297 [in] DXGI_SWAP_CHAIN_DESC *desc,
298 [out] IDXGISwapChain **swapchain
300 HRESULT CreateSoftwareAdapter(
301 [in] HMODULE swrast,
302 [out] IDXGIAdapter **adapter
306 [local] HRESULT CreateDXGIFactory(REFIID riid, void **factory);
309 object,
310 local,
311 uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
313 interface IDXGIDevice : IDXGIObject
315 HRESULT GetAdapter(
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(
331 [in] INT priority
333 HRESULT GetGPUThreadPriority(
334 [out] INT *priority