dxgi: Add the IDXGISwapChain interface.
[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 cpp_quote("#endif")
24
25 typedef UINT DXGI_USAGE;
26 const DXGI_USAGE DXGI_USAGE_SHADER_INPUT            = 0x10L;
27 const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT    = 0x20L;
28 const DXGI_USAGE DXGI_USAGE_BACK_BUFFER             = 0x40L;
29 const DXGI_USAGE DXGI_USAGE_SHARED                  = 0x80L;
30 const DXGI_USAGE DXGI_USAGE_READ_ONLY               = 0x100L;
31
32 typedef enum DXGI_SWAP_EFFECT {
33     DXGI_SWAP_EFFECT_DISCARD    = 0,
34     DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
35 } DXGI_SWAP_EFFECT;
36
37 typedef struct DXGI_SURFACE_DESC {
38     UINT Width;
39     UINT Height;
40     DXGI_FORMAT Format;
41     DXGI_SAMPLE_DESC SampleDesc;
42 } DXGI_SURFACE_DESC;
43
44 typedef struct DXGI_MAPPED_RECT {
45     INT Pitch;
46     BYTE *pBits;
47 } DXGI_MAPPED_RECT;
48
49 typedef struct DXGI_OUTPUT_DESC {
50     WCHAR DeviceName[32];
51     RECT DesktopCoordinates;
52     BOOL AttachedToDesktop;
53     DXGI_MODE_ROTATION Rotation;
54     HMONITOR Monitor;
55 } DXGI_OUTPUT_DESC;
56
57 typedef struct DXGI_FRAME_STATISTICS {
58     UINT PresentCount;
59     UINT PresentRefreshCount;
60     UINT SyncRefreshCount;
61     LARGE_INTEGER SyncQPCTime;
62     LARGE_INTEGER SyncGPUTime;
63 } DXGI_FRAME_STATISTICS;
64
65 typedef struct DXGI_SWAP_CHAIN_DESC {
66     DXGI_MODE_DESC BufferDesc;
67     DXGI_SAMPLE_DESC SampleDesc;
68     DXGI_USAGE BufferUsage;
69     UINT BufferCount;
70     HWND OutputWindow;
71     BOOL Windowed;
72     DXGI_SWAP_EFFECT SwapEffect;
73     UINT Flags;
74 } DXGI_SWAP_CHAIN_DESC;
75
76 [
77     object,
78     local,
79     uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
80 ]
81 interface IDXGIObject : IUnknown
82 {
83     HRESULT SetPrivateData(
84         [in] REFGUID guid,
85         [in] UINT data_size,
86         [in] const void *data
87     );
88     HRESULT SetPrivateDataInterface(
89         [in] REFGUID guid,
90         [in] const IUnknown *object
91     );
92     HRESULT GetPrivateData(
93         [in] REFGUID guid,
94         [in, out] UINT data_size,
95         [out] void *data
96     );
97     HRESULT GetParent(
98         [in] REFIID riid,
99         [out] void **parent
100     );
101 }
102
103 [
104     object,
105     local,
106     uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
107 ]
108 interface IDXGIDeviceSubObject : IDXGIObject
109 {
110     HRESULT GetDevice(
111         [in] REFIID riid,
112         [out] void **device
113     );
114 }
115
116 [
117     object,
118     local,
119     uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
120 ]
121 interface IDXGISurface : IDXGIDeviceSubObject
122 {
123     HRESULT GetDesc(
124         [out] DXGI_SURFACE_DESC *desc
125     );
126     HRESULT Map(
127         [out] DXGI_MAPPED_RECT *mapped_rect,
128         [in] UINT flags
129     );
130     HRESULT Unmap(
131     );
132 }
133
134 [
135     object,
136     local,
137     uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
138 ]
139 interface IDXGIOutput : IDXGIObject
140 {
141     HRESULT GetDesc(
142         [out] DXGI_OUTPUT_DESC *desc
143     );
144     HRESULT GetDisplayModeList(
145         [in] DXGI_FORMAT format,
146         [in] UINT flags,
147         [in, out] UINT *mode_count,
148         [out] DXGI_MODE_DESC *desc
149     );
150     HRESULT FindClosestMatchingMode(
151         [in] const DXGI_MODE_DESC *mode,
152         [out] DXGI_MODE_DESC *closest_match,
153         [in] IUnknown *device
154     );
155     HRESULT WaitForVBlank(
156     );
157     HRESULT TakeOwnership(
158         [in] IUnknown *device,
159         [in] BOOL exclusive
160     );
161     void ReleaseOwnership(
162     );
163     HRESULT GetGammaControlCapabilities(
164         [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
165     );
166     HRESULT SetGammaControl(
167         [in] const DXGI_GAMMA_CONTROL *gamma_control
168     );
169     HRESULT GetGammaControl(
170         [out] DXGI_GAMMA_CONTROL *gamma_control
171     );
172     HRESULT SetDisplaySurface(
173         [in] IDXGISurface *surface
174     );
175     HRESULT GetDisplaySurfaceData(
176         [in] IDXGISurface *surface
177     );
178     HRESULT GetFrameStatistics(
179         [out] DXGI_FRAME_STATISTICS *stats
180     );
181 }
182
183 [
184     object,
185     local,
186     uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
187 ]
188 interface IDXGISwapChain : IDXGIDeviceSubObject
189 {
190     HRESULT Present(
191         [in] UINT sync_interval,
192         [in] UINT flags
193     );
194     HRESULT GetBuffer(
195         [in] UINT buffer_idx,
196         [in] REFIID riid,
197         [in, out] void **surface
198     );
199     HRESULT SetFullscreenState(
200         [in] BOOL fullscreen,
201         [in] IDXGIOutput *target
202     );
203     HRESULT GetFullscreenState(
204         [out] BOOL *fullscreen,
205         [out] IDXGIOutput **target
206     );
207     HRESULT GetDesc(
208         [out] DXGI_SWAP_CHAIN_DESC *desc
209     );
210     HRESULT ResizeBuffers(
211         [in] UINT buffer_count,
212         [in] UINT width,
213         [in] UINT height,
214         [in] DXGI_FORMAT format,
215         [in] UINT flags
216     );
217     HRESULT ResizeTarget(
218         [in] const DXGI_MODE_DESC target_mode_desc
219     );
220     HRESULT GetContainingOutput(
221         [out] IDXGIOutput **output
222     );
223     HRESULT GetFrameStatistics(
224         [out] DXGI_FRAME_STATISTICS *stats
225     );
226     HRESULT GetLastPresentCount(
227         [out] UINT *last_present_count
228     );
229 }