wined3d: Support some more texture types for GLSL depth blts.
[wine] / include / dxgi.idl
1 /*
2  * Copyright 2007 Andras Kovacs
3  *
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.
8  *
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.
13  *
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
17  */
18
19 import "dxgitype.idl";
20
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")
28
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;
35
36 typedef enum DXGI_SWAP_EFFECT {
37     DXGI_SWAP_EFFECT_DISCARD    = 0,
38     DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
39 } DXGI_SWAP_EFFECT;
40
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;
46
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;
53
54 typedef struct DXGI_MAPPED_RECT {
55     INT Pitch;
56     BYTE *pBits;
57 } DXGI_MAPPED_RECT;
58
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;
66
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;
74
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;
86
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;
97
98 typedef struct DXGI_SHARED_RESOURCE {
99     HANDLE Handle;
100 } DXGI_SHARED_RESOURCE;
101
102 [
103     object,
104     local,
105     uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
106 ]
107 interface IDXGIObject : IUnknown
108 {
109     HRESULT SetPrivateData(
110         [in] REFGUID guid,
111         [in] UINT data_size,
112         [in] const void *data
113     );
114     HRESULT SetPrivateDataInterface(
115         [in] REFGUID guid,
116         [in] const IUnknown *object
117     );
118     HRESULT GetPrivateData(
119         [in] REFGUID guid,
120         [in, out] UINT *data_size,
121         [out] void *data
122     );
123     HRESULT GetParent(
124         [in] REFIID riid,
125         [out] void **parent
126     );
127 }
128
129 [
130     object,
131     local,
132     uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
133 ]
134 interface IDXGIDeviceSubObject : IDXGIObject
135 {
136     HRESULT GetDevice(
137         [in] REFIID riid,
138         [out] void **device
139     );
140 }
141
142 [
143     object,
144     local,
145     uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
146 ]
147 interface IDXGISurface : IDXGIDeviceSubObject
148 {
149     HRESULT GetDesc(
150         [out] DXGI_SURFACE_DESC *desc
151     );
152     HRESULT Map(
153         [out] DXGI_MAPPED_RECT *mapped_rect,
154         [in] UINT flags
155     );
156     HRESULT Unmap(
157     );
158 }
159
160 [
161     object,
162     local,
163     uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
164 ]
165 interface IDXGIOutput : IDXGIObject
166 {
167     HRESULT GetDesc(
168         [out] DXGI_OUTPUT_DESC *desc
169     );
170     HRESULT GetDisplayModeList(
171         [in] DXGI_FORMAT format,
172         [in] UINT flags,
173         [in, out] UINT *mode_count,
174         [out] DXGI_MODE_DESC *desc
175     );
176     HRESULT FindClosestMatchingMode(
177         [in] const DXGI_MODE_DESC *mode,
178         [out] DXGI_MODE_DESC *closest_match,
179         [in] IUnknown *device
180     );
181     HRESULT WaitForVBlank(
182     );
183     HRESULT TakeOwnership(
184         [in] IUnknown *device,
185         [in] BOOL exclusive
186     );
187     void ReleaseOwnership(
188     );
189     HRESULT GetGammaControlCapabilities(
190         [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
191     );
192     HRESULT SetGammaControl(
193         [in] const DXGI_GAMMA_CONTROL *gamma_control
194     );
195     HRESULT GetGammaControl(
196         [out] DXGI_GAMMA_CONTROL *gamma_control
197     );
198     HRESULT SetDisplaySurface(
199         [in] IDXGISurface *surface
200     );
201     HRESULT GetDisplaySurfaceData(
202         [in] IDXGISurface *surface
203     );
204     HRESULT GetFrameStatistics(
205         [out] DXGI_FRAME_STATISTICS *stats
206     );
207 }
208
209 [
210     object,
211     local,
212     uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
213 ]
214 interface IDXGIAdapter : IDXGIObject
215 {
216     HRESULT EnumOutputs(
217         [in] UINT output_idx,
218         [in, out] IDXGIOutput **output
219     );
220     HRESULT GetDesc(
221         [out] DXGI_ADAPTER_DESC *desc
222     );
223     HRESULT CheckInterfaceSupport(
224         [in] REFGUID guid,
225         [out] LARGE_INTEGER *umd_version
226     );
227 }
228
229 [
230     object,
231     local,
232     uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
233 ]
234 interface IDXGISwapChain : IDXGIDeviceSubObject
235 {
236     HRESULT Present(
237         [in] UINT sync_interval,
238         [in] UINT flags
239     );
240     HRESULT GetBuffer(
241         [in] UINT buffer_idx,
242         [in] REFIID riid,
243         [in, out] void **surface
244     );
245     HRESULT SetFullscreenState(
246         [in] BOOL fullscreen,
247         [in] IDXGIOutput *target
248     );
249     HRESULT GetFullscreenState(
250         [out] BOOL *fullscreen,
251         [out] IDXGIOutput **target
252     );
253     HRESULT GetDesc(
254         [out] DXGI_SWAP_CHAIN_DESC *desc
255     );
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
262     );
263     HRESULT ResizeTarget(
264         [in] const DXGI_MODE_DESC *target_mode_desc
265     );
266     HRESULT GetContainingOutput(
267         [out] IDXGIOutput **output
268     );
269     HRESULT GetFrameStatistics(
270         [out] DXGI_FRAME_STATISTICS *stats
271     );
272     HRESULT GetLastPresentCount(
273         [out] UINT *last_present_count
274     );
275 }
276
277 [
278     object,
279     local,
280     uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
281 ]
282 interface IDXGIFactory : IDXGIObject
283 {
284     HRESULT EnumAdapters(
285         [in] UINT adapter_idx,
286         [out] IDXGIAdapter **adapter
287     );
288     HRESULT MakeWindowAssociation(
289         [in] HWND window,
290         [in] UINT flags
291     );
292     HRESULT GetWindowAssociation(
293         [in] HWND *window
294     );
295     HRESULT CreateSwapChain(
296         [in] IUnknown *device,
297         [in] DXGI_SWAP_CHAIN_DESC *desc,
298         [out] IDXGISwapChain **swapchain
299     );
300     HRESULT CreateSoftwareAdapter(
301         [in] HMODULE swrast,
302         [out] IDXGIAdapter **adapter
303     );
304 }
305
306 [local] HRESULT CreateDXGIFactory(REFIID riid, void **factory);
307
308 [
309     object,
310     local,
311     uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
312 ]
313 interface IDXGIDevice : IDXGIObject
314 {
315     HRESULT GetAdapter(
316         [out] IDXGIAdapter **adapter
317     );
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
324     );
325     HRESULT QueryResourceResidency(
326         [in] IUnknown *const *resources,
327         [out] DXGI_RESIDENCY *residency,
328         [in] UINT resource_count
329     );
330     HRESULT SetGPUThreadPriority(
331         [in] INT priority
332     );
333     HRESULT GetGPUThreadPriority(
334         [out] INT *priority
335     );
336 }