1/*
2 * Copyright 2016 Józef Kucia for CodeWeavers
3 * Copyright 2016 Henri Verbeet for CodeWeavers
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20import "vkd3d_dxgitype.idl";
21
22#include "vkd3d_unknown.idl"
23
24typedef enum DXGI_SWAP_EFFECT
25{
26    DXGI_SWAP_EFFECT_DISCARD         = 0x0,
27    DXGI_SWAP_EFFECT_SEQUENTIAL      = 0x1,
28    DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL = 0x3,
29    DXGI_SWAP_EFFECT_FLIP_DISCARD    = 0x4,
30} DXGI_SWAP_EFFECT;
31
32typedef enum DXGI_MODE_ROTATION
33{
34    DXGI_MODE_ROTATION_UNSPECIFIED = 0x0,
35    DXGI_MODE_ROTATION_IDENTITY    = 0x1,
36    DXGI_MODE_ROTATION_ROTATE90    = 0x2,
37    DXGI_MODE_ROTATION_ROTATE180   = 0x3,
38    DXGI_MODE_ROTATION_ROTATE270   = 0x4,
39} DXGI_MODE_ROTATION;
40
41interface IDXGIAdapter1;
42interface IDXGIOutput;
43typedef struct DXGI_SWAP_CHAIN_DESC DXGI_SWAP_CHAIN_DESC;
44typedef struct DXGI_FRAME_STATISTICS DXGI_FRAME_STATISTICS;
45
46typedef UINT DXGI_USAGE;
47
48const DXGI_USAGE DXGI_USAGE_SHADER_INPUT         = 0x00000010ul;
49const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x00000020ul;
50const DXGI_USAGE DXGI_USAGE_BACK_BUFFER          = 0x00000040ul;
51const DXGI_USAGE DXGI_USAGE_SHARED               = 0x00000080ul;
52const DXGI_USAGE DXGI_USAGE_READ_ONLY            = 0x00000100ul;
53const DXGI_USAGE DXGI_USAGE_DISCARD_ON_PRESENT   = 0x00000200ul;
54const DXGI_USAGE DXGI_USAGE_UNORDERED_ACCESS     = 0x00000400ul;
55
56typedef struct DXGI_ADAPTER_DESC
57{
58    WCHAR Description[128];
59    UINT VendorId;
60    UINT DeviceId;
61    UINT SubSysId;
62    UINT Revision;
63    SIZE_T DedicatedVideoMemory;
64    SIZE_T DedicatedSystemMemory;
65    SIZE_T SharedSystemMemory;
66    LUID AdapterLuid;
67} DXGI_ADAPTER_DESC;
68
69[
70    local,
71    object,
72    uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e),
73    pointer_default(unique)
74]
75interface IDXGIObject : IUnknown
76{
77    HRESULT SetPrivateData(REFGUID name, UINT data_size, const void *data);
78    HRESULT GetPrivateDataInterface(REFGUID name, const IUnknown *unknown);
79    HRESULT GetPrivateData(REFGUID name, UINT *data_size, void *data);
80    HRESULT GetParent(REFIID riid, void **parent);
81}
82
83[
84    local,
85    object,
86    uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6),
87    pointer_default(unique)
88]
89interface IDXGIDeviceSubObject : IDXGIObject
90{
91    HRESULT GetDevice(REFIID riid, void **device);
92}
93
94[
95    object,
96    local,
97    uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
98]
99interface IDXGIAdapter : IDXGIObject
100{
101    HRESULT EnumOutputs(UINT output_idx, IDXGIOutput **output);
102    HRESULT GetDesc(DXGI_ADAPTER_DESC *desc);
103    HRESULT CheckInterfaceSupport(REFGUID guid, void *umd_version);
104}
105
106[
107    local,
108    object,
109    uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a),
110    pointer_default(unique)
111]
112interface IDXGISwapChain : IDXGIDeviceSubObject
113{
114    HRESULT Present(UINT sync_interval, UINT flags);
115    HRESULT GetBuffer(UINT buffer_idx, REFIID riid, void **surface);
116    HRESULT SetFullscreenState(BOOL fullscreen, IDXGIOutput *target);
117    HRESULT GetFullscreenState(BOOL *fullscreen, IDXGIOutput **target);
118    HRESULT GetDesc(DXGI_SWAP_CHAIN_DESC *desc);
119    HRESULT ResizeBuffers(UINT buffer_count, UINT width, UINT height, DXGI_FORMAT format, UINT flags);
120    HRESULT ResizeTarget(const DXGI_MODE_DESC *desc);
121    HRESULT GetContainingOutput(IDXGIOutput **output);
122    HRESULT GetFrameStatistics(DXGI_FRAME_STATISTICS *stats);
123    HRESULT GetLastPresentCount(UINT *last_present_count);
124}
125
126[
127    local,
128    object,
129    uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369),
130    pointer_default(unique)
131]
132interface IDXGIFactory : IDXGIObject
133{
134    HRESULT EnumAdapters(UINT adapter_idx, IDXGIAdapter **adapter);
135    HRESULT MakeWindowAssociation(HWND hwnd, UINT flags);
136    HRESULT GetWindowAssociation(HWND *hwnd);
137    HRESULT CreateSwapChain(IUnknown *device, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain);
138    HRESULT CreateSoftwareAdapter(HMODULE hmodule, IDXGIAdapter **adapter);
139}
140
141[
142    local,
143    object,
144    uuid(770aae78-f26f-4dba-a829-253c83d1b387),
145    pointer_default(unique)
146]
147interface IDXGIFactory1 : IDXGIFactory
148{
149    HRESULT EnumAdapters1(UINT adapter_idx, IDXGIAdapter1 **adpter);
150    BOOL IsCurrent();
151}
152
153[local] HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **factory);
154[local] HRESULT __stdcall CreateDXGIFactory1(REFIID riid, void **factory);
155