ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/MSYS2/mingw32/i686-w64-mingw32/include/dxgi.idl
Revision: 1166
Committed: Tue Oct 26 14:22:36 2021 UTC (4 years ago) by rossy
File size: 13830 byte(s)
Log Message:
Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File Contents

# Content
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 "oaidl.idl";
20 import "ocidl.idl";
21 import "dxgitype.idl";
22
23 const UINT _FACDXGI = 0x87a;
24
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)")
27
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")
35
36 const UINT DXGI_CPU_ACCESS_NONE = 0;
37 const UINT DXGI_CPU_ACCESS_DYNAMIC = 1;
38 const UINT DXGI_CPU_ACCESS_READ_WRITE = 2;
39 const UINT DXGI_CPU_ACCESS_SCRATCH = 3;
40 const UINT DXGI_CPU_ACCESS_FIELD = 15;
41
42 typedef UINT DXGI_USAGE;
43 const DXGI_USAGE DXGI_USAGE_SHADER_INPUT = 0x10L;
44 const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20L;
45 const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L;
46 const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L;
47 const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L;
48 const DXGI_USAGE DXGI_USAGE_DISCARD_ON_PRESENT = 0x200L;
49 const DXGI_USAGE DXGI_USAGE_UNORDERED_ACCESS = 0x400L;
50
51 const UINT DXGI_ENUM_MODES_INTERLACED = 1;
52 const UINT DXGI_ENUM_MODES_SCALING = 2;
53
54 const UINT DXGI_RESOURCE_PRIORITY_MINIMUM = 0x28000000;
55 const UINT DXGI_RESOURCE_PRIORITY_LOW = 0x50000000;
56 const UINT DXGI_RESOURCE_PRIORITY_NORMAL = 0x78000000;
57 const UINT DXGI_RESOURCE_PRIORITY_HIGH = 0xa0000000;
58 const UINT DXGI_RESOURCE_PRIORITY_MAXIMUM = 0xc8000000;
59
60 const UINT DXGI_MAP_READ = 0x1;
61 const UINT DXGI_MAP_WRITE = 0x2;
62 const UINT DXGI_MAP_DISCARD = 0x4;
63
64 typedef enum DXGI_SWAP_EFFECT {
65 DXGI_SWAP_EFFECT_DISCARD = 0,
66 DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
67 DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL = 3,
68 DXGI_SWAP_EFFECT_FLIP_DISCARD = 4
69 } DXGI_SWAP_EFFECT;
70
71 typedef enum DXGI_RESIDENCY {
72 DXGI_RESIDENCY_FULLY_RESIDENT = 1,
73 DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
74 DXGI_RESIDENCY_EVICTED_TO_DISK = 3,
75 } DXGI_RESIDENCY;
76
77 typedef struct DXGI_SURFACE_DESC {
78 UINT Width;
79 UINT Height;
80 DXGI_FORMAT Format;
81 DXGI_SAMPLE_DESC SampleDesc;
82 } DXGI_SURFACE_DESC;
83
84 typedef struct DXGI_MAPPED_RECT {
85 INT Pitch;
86 BYTE *pBits;
87 } DXGI_MAPPED_RECT;
88
89 typedef struct DXGI_OUTPUT_DESC {
90 WCHAR DeviceName[32];
91 RECT DesktopCoordinates;
92 BOOL AttachedToDesktop;
93 DXGI_MODE_ROTATION Rotation;
94 HMONITOR Monitor;
95 } DXGI_OUTPUT_DESC;
96
97 typedef struct DXGI_FRAME_STATISTICS {
98 UINT PresentCount;
99 UINT PresentRefreshCount;
100 UINT SyncRefreshCount;
101 LARGE_INTEGER SyncQPCTime;
102 LARGE_INTEGER SyncGPUTime;
103 } DXGI_FRAME_STATISTICS;
104
105 typedef struct DXGI_ADAPTER_DESC {
106 WCHAR Description[128];
107 UINT VendorId;
108 UINT DeviceId;
109 UINT SubSysId;
110 UINT Revision;
111 SIZE_T DedicatedVideoMemory;
112 SIZE_T DedicatedSystemMemory;
113 SIZE_T SharedSystemMemory;
114 LUID AdapterLuid;
115 } DXGI_ADAPTER_DESC;
116
117 typedef enum DXGI_SWAP_CHAIN_FLAG
118 {
119 DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 0x0001,
120 DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 0x0002,
121 DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 0x0004,
122 DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT = 0x0008,
123 DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER = 0x0010,
124 DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY = 0x0020,
125 DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT = 0x0040,
126 DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER = 0x0080,
127 DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO = 0x0100,
128 DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO = 0x0200,
129 DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED = 0x0400,
130 DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING = 0x0800,
131 DXGI_SWAP_CHAIN_FLAG_RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS = 0x1000,
132 } DXGI_SWAP_CHAIN_FLAG;
133
134 typedef struct DXGI_SWAP_CHAIN_DESC {
135 DXGI_MODE_DESC BufferDesc;
136 DXGI_SAMPLE_DESC SampleDesc;
137 DXGI_USAGE BufferUsage;
138 UINT BufferCount;
139 HWND OutputWindow;
140 BOOL Windowed;
141 DXGI_SWAP_EFFECT SwapEffect;
142 UINT Flags;
143 } DXGI_SWAP_CHAIN_DESC;
144
145 typedef struct DXGI_SHARED_RESOURCE {
146 HANDLE Handle;
147 } DXGI_SHARED_RESOURCE;
148
149 [
150 object,
151 local,
152 uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
153 ]
154 interface IDXGIObject : IUnknown
155 {
156 HRESULT SetPrivateData(
157 [in] REFGUID guid,
158 [in] UINT data_size,
159 [in] const void *data
160 );
161 HRESULT SetPrivateDataInterface(
162 [in] REFGUID guid,
163 [in] const IUnknown *object
164 );
165 HRESULT GetPrivateData(
166 [in] REFGUID guid,
167 [in, out] UINT *data_size,
168 [out] void *data
169 );
170 HRESULT GetParent(
171 [in] REFIID riid,
172 [out] void **parent
173 );
174 }
175
176 [
177 object,
178 local,
179 uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
180 ]
181 interface IDXGIDeviceSubObject : IDXGIObject
182 {
183 HRESULT GetDevice(
184 [in] REFIID riid,
185 [out] void **device
186 );
187 }
188
189 [
190 object,
191 uuid(035f3ab4-482e-4e50-b41f-8a7f8bd8960b),
192 local,
193 pointer_default(unique)
194 ]
195 interface IDXGIResource : IDXGIDeviceSubObject
196 {
197 HRESULT GetSharedHandle([out] HANDLE *pSharedHandle);
198 HRESULT GetUsage([out] DXGI_USAGE *pUsage);
199 HRESULT SetEvictionPriority([in] UINT EvictionPriority);
200 HRESULT GetEvictionPriority([out, retval] UINT *pEvictionPriority);
201 }
202
203 [
204 object,
205 uuid(9d8e1289-d7b3-465f-8126-250e349af85d),
206 local,
207 pointer_default(unique)
208 ]
209 interface IDXGIKeyedMutex : IDXGIDeviceSubObject
210 {
211 HRESULT AcquireSync([in] UINT64 Key, [in] DWORD dwMilliseconds);
212 HRESULT ReleaseSync([in] UINT64 Key);
213 }
214
215 [
216 object,
217 local,
218 uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
219 ]
220 interface IDXGISurface : IDXGIDeviceSubObject
221 {
222 HRESULT GetDesc(
223 [out] DXGI_SURFACE_DESC *desc
224 );
225 HRESULT Map(
226 [out] DXGI_MAPPED_RECT *mapped_rect,
227 [in] UINT flags
228 );
229 HRESULT Unmap(
230 );
231 }
232
233 [
234 object,
235 local,
236 uuid(4ae63092-6327-4c1b-80ae-bfe12ea32b86)
237 ]
238 interface IDXGISurface1 : IDXGISurface
239 {
240 HRESULT GetDC(
241 [in] BOOL discard,
242 [out] HDC *hdc
243 );
244 HRESULT ReleaseDC(
245 [in] RECT *dirty_rect
246 );
247 }
248
249 [
250 object,
251 local,
252 uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
253 ]
254 interface IDXGIOutput : IDXGIObject
255 {
256 HRESULT GetDesc(
257 [out] DXGI_OUTPUT_DESC *desc
258 );
259 HRESULT GetDisplayModeList(
260 [in] DXGI_FORMAT format,
261 [in] UINT flags,
262 [in, out] UINT *mode_count,
263 [out] DXGI_MODE_DESC *desc
264 );
265 HRESULT FindClosestMatchingMode(
266 [in] const DXGI_MODE_DESC *mode,
267 [out] DXGI_MODE_DESC *closest_match,
268 [in] IUnknown *device
269 );
270 HRESULT WaitForVBlank(
271 );
272 HRESULT TakeOwnership(
273 [in] IUnknown *device,
274 [in] BOOL exclusive
275 );
276 void ReleaseOwnership(
277 );
278 HRESULT GetGammaControlCapabilities(
279 [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
280 );
281 HRESULT SetGammaControl(
282 [in] const DXGI_GAMMA_CONTROL *gamma_control
283 );
284 HRESULT GetGammaControl(
285 [out] DXGI_GAMMA_CONTROL *gamma_control
286 );
287 HRESULT SetDisplaySurface(
288 [in] IDXGISurface *surface
289 );
290 HRESULT GetDisplaySurfaceData(
291 [in] IDXGISurface *surface
292 );
293 HRESULT GetFrameStatistics(
294 [out] DXGI_FRAME_STATISTICS *stats
295 );
296 }
297
298 [
299 object,
300 local,
301 uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
302 ]
303 interface IDXGIAdapter : IDXGIObject
304 {
305 HRESULT EnumOutputs(
306 [in] UINT output_idx,
307 [in, out] IDXGIOutput **output
308 );
309 HRESULT GetDesc(
310 [out] DXGI_ADAPTER_DESC *desc
311 );
312 HRESULT CheckInterfaceSupport(
313 [in] REFGUID guid,
314 [out] LARGE_INTEGER *umd_version
315 );
316 }
317
318 cpp_quote("#define DXGI_MAX_SWAP_CHAIN_BUFFERS (16)")
319
320 cpp_quote("#define DXGI_PRESENT_TEST __MSABI_LONG(0x00000001U)")
321 cpp_quote("#define DXGI_PRESENT_DO_NOT_SEQUENCE __MSABI_LONG(0x00000002U)")
322 cpp_quote("#define DXGI_PRESENT_RESTART __MSABI_LONG(0x00000004U)")
323 cpp_quote("#define DXGI_PRESENT_DO_NOT_WAIT __MSABI_LONG(0x00000008U)")
324 cpp_quote("#define DXGI_PRESENT_STEREO_PREFER_RIGHT __MSABI_LONG(0x00000010U)")
325 cpp_quote("#define DXGI_PRESENT_STEREO_TEMPORARY_MONO __MSABI_LONG(0x00000020U)")
326 cpp_quote("#define DXGI_PRESENT_RESTRICT_TO_OUTPUT __MSABI_LONG(0x00000040U)")
327 cpp_quote("#define DXGI_PRESENT_USE_DURATION __MSABI_LONG(0x00000100U)")
328 cpp_quote("#define DXGI_PRESENT_ALLOW_TEARING __MSABI_LONG(0x00000200U)")
329
330 [
331 object,
332 local,
333 uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
334 ]
335 interface IDXGISwapChain : IDXGIDeviceSubObject
336 {
337 HRESULT Present(
338 [in] UINT sync_interval,
339 [in] UINT flags
340 );
341 HRESULT GetBuffer(
342 [in] UINT buffer_idx,
343 [in] REFIID riid,
344 [in, out] void **surface
345 );
346 HRESULT SetFullscreenState(
347 [in] BOOL fullscreen,
348 [in] IDXGIOutput *target
349 );
350 HRESULT GetFullscreenState(
351 [out] BOOL *fullscreen,
352 [out] IDXGIOutput **target
353 );
354 HRESULT GetDesc(
355 [out] DXGI_SWAP_CHAIN_DESC *desc
356 );
357 HRESULT ResizeBuffers(
358 [in] UINT buffer_count,
359 [in] UINT width,
360 [in] UINT height,
361 [in] DXGI_FORMAT format,
362 [in] UINT flags
363 );
364 HRESULT ResizeTarget(
365 [in] const DXGI_MODE_DESC *target_mode_desc
366 );
367 HRESULT GetContainingOutput(
368 [out] IDXGIOutput **output
369 );
370 HRESULT GetFrameStatistics(
371 [out] DXGI_FRAME_STATISTICS *stats
372 );
373 HRESULT GetLastPresentCount(
374 [out] UINT *last_present_count
375 );
376 }
377
378 cpp_quote("#define DXGI_MWA_NO_WINDOW_CHANGES 0x1")
379 cpp_quote("#define DXGI_MWA_NO_ALT_ENTER 0x2")
380 cpp_quote("#define DXGI_MWA_NO_PRINT_SCREEN 0x4")
381 cpp_quote("#define DXGI_MWA_VALID 0x7")
382
383 [
384 object,
385 local,
386 uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
387 ]
388 interface IDXGIFactory : IDXGIObject
389 {
390 HRESULT EnumAdapters(
391 [in] UINT adapter_idx,
392 [out] IDXGIAdapter **adapter
393 );
394 HRESULT MakeWindowAssociation(
395 [in] HWND window,
396 [in] UINT flags
397 );
398 HRESULT GetWindowAssociation(
399 [in] HWND *window
400 );
401 HRESULT CreateSwapChain(
402 [in] IUnknown *device,
403 [in] DXGI_SWAP_CHAIN_DESC *desc,
404 [out] IDXGISwapChain **swapchain
405 );
406 HRESULT CreateSoftwareAdapter(
407 [in] HMODULE swrast,
408 [out] IDXGIAdapter **adapter
409 );
410 }
411
412 [local] HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **factory);
413 [local] HRESULT __stdcall CreateDXGIFactory1(REFIID riid, void **factory);
414
415 [
416 object,
417 local,
418 uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
419 ]
420 interface IDXGIDevice : IDXGIObject
421 {
422 HRESULT GetAdapter(
423 [out] IDXGIAdapter **adapter
424 );
425 HRESULT CreateSurface(
426 [in] const DXGI_SURFACE_DESC *desc,
427 [in] UINT surface_count,
428 [in] DXGI_USAGE usage,
429 [in] const DXGI_SHARED_RESOURCE *shared_resource,
430 [out] IDXGISurface **surface
431 );
432 HRESULT QueryResourceResidency(
433 [in] IUnknown *const *resources,
434 [out] DXGI_RESIDENCY *residency,
435 [in] UINT resource_count
436 );
437 HRESULT SetGPUThreadPriority(
438 [in] INT priority
439 );
440 HRESULT GetGPUThreadPriority(
441 [out] INT *priority
442 );
443 }
444
445 typedef enum DXGI_ADAPTER_FLAG {
446 DXGI_ADAPTER_FLAG_NONE = 0,
447 DXGI_ADAPTER_FLAG_REMOTE = 1,
448 DXGI_ADAPTER_FLAG_SOFTWARE = 2,
449 DXGI_ADAPTER_FLAG_FORCE_DWORD = 0xFFFFFFFF
450 } DXGI_ADAPTER_FLAG;
451
452 typedef struct DXGI_ADAPTER_DESC1 {
453 WCHAR Description[128];
454 UINT VendorId;
455 UINT DeviceId;
456 UINT SubSysId;
457 UINT Revision;
458 SIZE_T DedicatedVideoMemory;
459 SIZE_T DedicatedSystemMemory;
460 SIZE_T SharedSystemMemory;
461 LUID AdapterLuid;
462 UINT Flags;
463 } DXGI_ADAPTER_DESC1;
464
465 typedef struct DXGI_DISPLAY_COLOR_SPACE {
466 FLOAT PrimaryCoordinates[8][2];
467 FLOAT WhitePoints[16][2];
468 } DXGI_DISPLAY_COLOR_SPACE;
469
470 [
471 object,
472 uuid(29038f61-3839-4626-91fd-086879011a05),
473 local,
474 pointer_default(unique)
475 ]
476 interface IDXGIAdapter1 : IDXGIAdapter
477 {
478 HRESULT GetDesc1([out] DXGI_ADAPTER_DESC1 *pDesc);
479 }
480
481 [
482 object,
483 uuid(77db970f-6276-48ba-ba28-070143b4392c),
484 local,
485 pointer_default(unique)
486 ]
487 interface IDXGIDevice1 : IDXGIDevice
488 {
489 HRESULT SetMaximumFrameLatency([in] UINT MaxLatency);
490 HRESULT GetMaximumFrameLatency([out] UINT *pMaxLatency);
491 }
492
493 [
494 object,
495 uuid(770aae78-f26f-4dba-a829-253c83d1b387),
496 local,
497 pointer_default(unique)
498 ]
499 interface IDXGIFactory1 : IDXGIFactory
500 {
501 HRESULT EnumAdapters1([in] UINT Adapter, [out] IDXGIAdapter1 **ppAdapter);
502 BOOL IsCurrent();
503 }