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 | /*
|
---|
20 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | import "dxgitype.idl";
|
---|
29 |
|
---|
30 | const UINT _FACDXGI = 0x87a;
|
---|
31 |
|
---|
32 | cpp_quote("#define MAKE_DXGI_STATUS(x) MAKE_HRESULT(0, _FACDXGI, x)")
|
---|
33 | cpp_quote("#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1)")
|
---|
34 | cpp_quote("#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2)")
|
---|
35 | cpp_quote("#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4)")
|
---|
36 | cpp_quote("#define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5)")
|
---|
37 | cpp_quote("#define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6)")
|
---|
38 | cpp_quote("#define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7)")
|
---|
39 | cpp_quote("#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8)")
|
---|
40 |
|
---|
41 | cpp_quote("#define MAKE_DXGI_HRESULT(x) MAKE_HRESULT(1, _FACDXGI, x)")
|
---|
42 | cpp_quote("#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)")
|
---|
43 | cpp_quote("#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2)")
|
---|
44 | cpp_quote("#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3)")
|
---|
45 | cpp_quote("#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4)")
|
---|
46 | cpp_quote("#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5)")
|
---|
47 | cpp_quote("#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6)")
|
---|
48 | cpp_quote("#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7)")
|
---|
49 | cpp_quote("#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10)")
|
---|
50 | cpp_quote("#define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11)")
|
---|
51 | cpp_quote("#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12)")
|
---|
52 | cpp_quote("#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32)")
|
---|
53 | cpp_quote("#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33)")
|
---|
54 | cpp_quote("#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34)")
|
---|
55 |
|
---|
56 | cpp_quote("#if 0")
|
---|
57 | typedef HANDLE HMONITOR;
|
---|
58 | typedef struct _LUID {
|
---|
59 | DWORD LowPart;
|
---|
60 | LONG HighPart;
|
---|
61 | } LUID, *PLUID;
|
---|
62 | cpp_quote("#endif")
|
---|
63 |
|
---|
64 | typedef UINT DXGI_USAGE;
|
---|
65 | const DXGI_USAGE DXGI_USAGE_SHADER_INPUT = 0x10L;
|
---|
66 | const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20L;
|
---|
67 | const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L;
|
---|
68 | const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L;
|
---|
69 | const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L;
|
---|
70 |
|
---|
71 | typedef enum DXGI_SWAP_EFFECT {
|
---|
72 | DXGI_SWAP_EFFECT_DISCARD = 0,
|
---|
73 | DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
|
---|
74 | } DXGI_SWAP_EFFECT;
|
---|
75 |
|
---|
76 | typedef enum DXGI_RESIDENCY {
|
---|
77 | DXGI_RESIDENCY_FULLY_RESIDENT = 1,
|
---|
78 | DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
|
---|
79 | DXGI_RESIDENCY_EVICTED_TO_DISK = 3,
|
---|
80 | } DXGI_RESIDENCY;
|
---|
81 |
|
---|
82 | typedef struct DXGI_SURFACE_DESC {
|
---|
83 | UINT Width;
|
---|
84 | UINT Height;
|
---|
85 | DXGI_FORMAT Format;
|
---|
86 | DXGI_SAMPLE_DESC SampleDesc;
|
---|
87 | } DXGI_SURFACE_DESC;
|
---|
88 |
|
---|
89 | typedef struct DXGI_MAPPED_RECT {
|
---|
90 | INT Pitch;
|
---|
91 | BYTE *pBits;
|
---|
92 | } DXGI_MAPPED_RECT;
|
---|
93 |
|
---|
94 | typedef struct DXGI_OUTPUT_DESC {
|
---|
95 | WCHAR DeviceName[32];
|
---|
96 | RECT DesktopCoordinates;
|
---|
97 | BOOL AttachedToDesktop;
|
---|
98 | DXGI_MODE_ROTATION Rotation;
|
---|
99 | HMONITOR Monitor;
|
---|
100 | } DXGI_OUTPUT_DESC;
|
---|
101 |
|
---|
102 | typedef struct DXGI_FRAME_STATISTICS {
|
---|
103 | UINT PresentCount;
|
---|
104 | UINT PresentRefreshCount;
|
---|
105 | UINT SyncRefreshCount;
|
---|
106 | LARGE_INTEGER SyncQPCTime;
|
---|
107 | LARGE_INTEGER SyncGPUTime;
|
---|
108 | } DXGI_FRAME_STATISTICS;
|
---|
109 |
|
---|
110 | typedef struct DXGI_ADAPTER_DESC {
|
---|
111 | WCHAR Description[128];
|
---|
112 | UINT VendorId;
|
---|
113 | UINT DeviceId;
|
---|
114 | UINT SubSysId;
|
---|
115 | UINT Revision;
|
---|
116 | SIZE_T DedicatedVideoMemory;
|
---|
117 | SIZE_T DedicatedSystemMemory;
|
---|
118 | SIZE_T SharedSystemMemory;
|
---|
119 | LUID AdapterLuid;
|
---|
120 | } DXGI_ADAPTER_DESC;
|
---|
121 |
|
---|
122 | typedef struct DXGI_SWAP_CHAIN_DESC {
|
---|
123 | DXGI_MODE_DESC BufferDesc;
|
---|
124 | DXGI_SAMPLE_DESC SampleDesc;
|
---|
125 | DXGI_USAGE BufferUsage;
|
---|
126 | UINT BufferCount;
|
---|
127 | HWND OutputWindow;
|
---|
128 | BOOL Windowed;
|
---|
129 | DXGI_SWAP_EFFECT SwapEffect;
|
---|
130 | UINT Flags;
|
---|
131 | } DXGI_SWAP_CHAIN_DESC;
|
---|
132 |
|
---|
133 | typedef struct DXGI_SHARED_RESOURCE {
|
---|
134 | HANDLE Handle;
|
---|
135 | } DXGI_SHARED_RESOURCE;
|
---|
136 |
|
---|
137 | [
|
---|
138 | object,
|
---|
139 | local,
|
---|
140 | uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
|
---|
141 | ]
|
---|
142 | interface IDXGIObject : IUnknown
|
---|
143 | {
|
---|
144 | HRESULT SetPrivateData(
|
---|
145 | [in] REFGUID guid,
|
---|
146 | [in] UINT data_size,
|
---|
147 | [in] const void *data
|
---|
148 | );
|
---|
149 | HRESULT SetPrivateDataInterface(
|
---|
150 | [in] REFGUID guid,
|
---|
151 | [in] const IUnknown *object
|
---|
152 | );
|
---|
153 | HRESULT GetPrivateData(
|
---|
154 | [in] REFGUID guid,
|
---|
155 | [in, out] UINT *data_size,
|
---|
156 | [out] void *data
|
---|
157 | );
|
---|
158 | HRESULT GetParent(
|
---|
159 | [in] REFIID riid,
|
---|
160 | [out] void **parent
|
---|
161 | );
|
---|
162 | }
|
---|
163 |
|
---|
164 | [
|
---|
165 | object,
|
---|
166 | local,
|
---|
167 | uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
|
---|
168 | ]
|
---|
169 | interface IDXGIDeviceSubObject : IDXGIObject
|
---|
170 | {
|
---|
171 | HRESULT GetDevice(
|
---|
172 | [in] REFIID riid,
|
---|
173 | [out] void **device
|
---|
174 | );
|
---|
175 | }
|
---|
176 |
|
---|
177 | [
|
---|
178 | object,
|
---|
179 | local,
|
---|
180 | uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
|
---|
181 | ]
|
---|
182 | interface IDXGISurface : IDXGIDeviceSubObject
|
---|
183 | {
|
---|
184 | HRESULT GetDesc(
|
---|
185 | [out] DXGI_SURFACE_DESC *desc
|
---|
186 | );
|
---|
187 | HRESULT Map(
|
---|
188 | [out] DXGI_MAPPED_RECT *mapped_rect,
|
---|
189 | [in] UINT flags
|
---|
190 | );
|
---|
191 | HRESULT Unmap(
|
---|
192 | );
|
---|
193 | }
|
---|
194 |
|
---|
195 | [
|
---|
196 | object,
|
---|
197 | local,
|
---|
198 | uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
|
---|
199 | ]
|
---|
200 | interface IDXGIOutput : IDXGIObject
|
---|
201 | {
|
---|
202 | HRESULT GetDesc(
|
---|
203 | [out] DXGI_OUTPUT_DESC *desc
|
---|
204 | );
|
---|
205 | HRESULT GetDisplayModeList(
|
---|
206 | [in] DXGI_FORMAT format,
|
---|
207 | [in] UINT flags,
|
---|
208 | [in, out] UINT *mode_count,
|
---|
209 | [out] DXGI_MODE_DESC *desc
|
---|
210 | );
|
---|
211 | HRESULT FindClosestMatchingMode(
|
---|
212 | [in] const DXGI_MODE_DESC *mode,
|
---|
213 | [out] DXGI_MODE_DESC *closest_match,
|
---|
214 | [in] IUnknown *device
|
---|
215 | );
|
---|
216 | HRESULT WaitForVBlank(
|
---|
217 | );
|
---|
218 | HRESULT TakeOwnership(
|
---|
219 | [in] IUnknown *device,
|
---|
220 | [in] BOOL exclusive
|
---|
221 | );
|
---|
222 | void ReleaseOwnership(
|
---|
223 | );
|
---|
224 | HRESULT GetGammaControlCapabilities(
|
---|
225 | [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
|
---|
226 | );
|
---|
227 | HRESULT SetGammaControl(
|
---|
228 | [in] const DXGI_GAMMA_CONTROL *gamma_control
|
---|
229 | );
|
---|
230 | HRESULT GetGammaControl(
|
---|
231 | [out] DXGI_GAMMA_CONTROL *gamma_control
|
---|
232 | );
|
---|
233 | HRESULT SetDisplaySurface(
|
---|
234 | [in] IDXGISurface *surface
|
---|
235 | );
|
---|
236 | HRESULT GetDisplaySurfaceData(
|
---|
237 | [in] IDXGISurface *surface
|
---|
238 | );
|
---|
239 | HRESULT GetFrameStatistics(
|
---|
240 | [out] DXGI_FRAME_STATISTICS *stats
|
---|
241 | );
|
---|
242 | }
|
---|
243 |
|
---|
244 | [
|
---|
245 | object,
|
---|
246 | local,
|
---|
247 | uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
|
---|
248 | ]
|
---|
249 | interface IDXGIAdapter : IDXGIObject
|
---|
250 | {
|
---|
251 | HRESULT EnumOutputs(
|
---|
252 | [in] UINT output_idx,
|
---|
253 | [in, out] IDXGIOutput **output
|
---|
254 | );
|
---|
255 | HRESULT GetDesc(
|
---|
256 | [out] DXGI_ADAPTER_DESC *desc
|
---|
257 | );
|
---|
258 | HRESULT CheckInterfaceSupport(
|
---|
259 | [in] REFGUID guid,
|
---|
260 | [out] LARGE_INTEGER *umd_version
|
---|
261 | );
|
---|
262 | }
|
---|
263 |
|
---|
264 | [
|
---|
265 | object,
|
---|
266 | local,
|
---|
267 | uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
|
---|
268 | ]
|
---|
269 | interface IDXGISwapChain : IDXGIDeviceSubObject
|
---|
270 | {
|
---|
271 | HRESULT Present(
|
---|
272 | [in] UINT sync_interval,
|
---|
273 | [in] UINT flags
|
---|
274 | );
|
---|
275 | HRESULT GetBuffer(
|
---|
276 | [in] UINT buffer_idx,
|
---|
277 | [in] REFIID riid,
|
---|
278 | [in, out] void **surface
|
---|
279 | );
|
---|
280 | HRESULT SetFullscreenState(
|
---|
281 | [in] BOOL fullscreen,
|
---|
282 | [in] IDXGIOutput *target
|
---|
283 | );
|
---|
284 | HRESULT GetFullscreenState(
|
---|
285 | [out] BOOL *fullscreen,
|
---|
286 | [out] IDXGIOutput **target
|
---|
287 | );
|
---|
288 | HRESULT GetDesc(
|
---|
289 | [out] DXGI_SWAP_CHAIN_DESC *desc
|
---|
290 | );
|
---|
291 | HRESULT ResizeBuffers(
|
---|
292 | [in] UINT buffer_count,
|
---|
293 | [in] UINT width,
|
---|
294 | [in] UINT height,
|
---|
295 | [in] DXGI_FORMAT format,
|
---|
296 | [in] UINT flags
|
---|
297 | );
|
---|
298 | HRESULT ResizeTarget(
|
---|
299 | [in] const DXGI_MODE_DESC *target_mode_desc
|
---|
300 | );
|
---|
301 | HRESULT GetContainingOutput(
|
---|
302 | [out] IDXGIOutput **output
|
---|
303 | );
|
---|
304 | HRESULT GetFrameStatistics(
|
---|
305 | [out] DXGI_FRAME_STATISTICS *stats
|
---|
306 | );
|
---|
307 | HRESULT GetLastPresentCount(
|
---|
308 | [out] UINT *last_present_count
|
---|
309 | );
|
---|
310 | }
|
---|
311 |
|
---|
312 | [
|
---|
313 | object,
|
---|
314 | local,
|
---|
315 | uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
|
---|
316 | ]
|
---|
317 | interface IDXGIFactory : IDXGIObject
|
---|
318 | {
|
---|
319 | HRESULT EnumAdapters(
|
---|
320 | [in] UINT adapter_idx,
|
---|
321 | [out] IDXGIAdapter **adapter
|
---|
322 | );
|
---|
323 | HRESULT MakeWindowAssociation(
|
---|
324 | [in] HWND window,
|
---|
325 | [in] UINT flags
|
---|
326 | );
|
---|
327 | HRESULT GetWindowAssociation(
|
---|
328 | [in] HWND *window
|
---|
329 | );
|
---|
330 | HRESULT CreateSwapChain(
|
---|
331 | [in] IUnknown *device,
|
---|
332 | [in] DXGI_SWAP_CHAIN_DESC *desc,
|
---|
333 | [out] IDXGISwapChain **swapchain
|
---|
334 | );
|
---|
335 | HRESULT CreateSoftwareAdapter(
|
---|
336 | [in] HMODULE swrast,
|
---|
337 | [out] IDXGIAdapter **adapter
|
---|
338 | );
|
---|
339 | }
|
---|
340 |
|
---|
341 | [local] HRESULT CreateDXGIFactory(REFIID riid, void **factory);
|
---|
342 |
|
---|
343 | [
|
---|
344 | object,
|
---|
345 | local,
|
---|
346 | uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
|
---|
347 | ]
|
---|
348 | interface IDXGIDevice : IDXGIObject
|
---|
349 | {
|
---|
350 | HRESULT GetAdapter(
|
---|
351 | [out] IDXGIAdapter **adapter
|
---|
352 | );
|
---|
353 | HRESULT CreateSurface(
|
---|
354 | [in] const DXGI_SURFACE_DESC *desc,
|
---|
355 | [in] UINT surface_count,
|
---|
356 | [in] DXGI_USAGE usage,
|
---|
357 | [in] const DXGI_SHARED_RESOURCE *shared_resource,
|
---|
358 | [out] IDXGISurface **surface
|
---|
359 | );
|
---|
360 | HRESULT QueryResourceResidency(
|
---|
361 | [in] IUnknown *const *resources,
|
---|
362 | [out] DXGI_RESIDENCY *residency,
|
---|
363 | [in] UINT resource_count
|
---|
364 | );
|
---|
365 | HRESULT SetGPUThreadPriority(
|
---|
366 | [in] INT priority
|
---|
367 | );
|
---|
368 | HRESULT GetGPUThreadPriority(
|
---|
369 | [out] INT *priority
|
---|
370 | );
|
---|
371 | }
|
---|