1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
#![allow(non_snake_case, dead_code, non_camel_case_types)]
use winapi::{ WCHAR, UINT, SIZE_T,
LUID, LARGE_INTEGER, BOOL,
FLOAT, RECT, HMONITOR,
POINT, HANDLE, INT,
BYTE, HWND, c_char,
c_float, c_int };
use constants::*;
use enumerations::*;
pub type DXGI_INFO_QUEUE_MESSAGE_ID = c_int;
#[repr(C)] pub struct DXGI_ADAPTER_DESC {
pub Description: [WCHAR; 128],
pub VendorId: UINT,
pub DeviceId: UINT,
pub SubSysId: UINT,
pub Revision: UINT,
pub DedicatedVideoMemory: SIZE_T,
pub DedicatedSystemMemory: SIZE_T,
pub SharedSystemMemory: SIZE_T,
pub AdapterLuid: LUID,
}
#[repr(C)] pub struct DXGI_ADAPTER_DESC1 {
pub Description: [WCHAR; 128],
pub VendorId: UINT,
pub DeviceId: UINT,
pub SubSysId: UINT,
pub Revision: UINT,
pub DedicatedVideoMemory: SIZE_T,
pub DedicatedSystemMemory: SIZE_T,
pub SharedSystemMemory: SIZE_T,
pub AdapterLuid: LUID,
pub Flags: UINT,
}
#[repr(C)] pub struct DXGI_ADAPTER_DESC2 {
pub Description: [WCHAR; 128],
pub VendorId: UINT,
pub DeviceId: UINT,
pub SubSysId: UINT,
pub Revision: UINT,
pub DedicatedVideoMemory: SIZE_T,
pub DedicatedSystemMemory: SIZE_T,
pub SharedSystemMemory: SIZE_T,
pub AdapterLuid: LUID,
pub Flags: UINT,
pub GraphicsPreemptionGranularity: DXGI_GRAPHICS_PREEMPTION_GRANULARITY,
pub ComputePreemptionGranularity: DXGI_COMPUTE_PREEMPTION_GRANULARITY,
}
#[repr(C)] pub struct DXGI_DECODE_SWAP_CHAIN_DESC {
pub Flags: UINT,
}
#[repr(C)] pub struct DXGI_FRAME_STATISTICS {
pub PresentCount: UINT,
pub PresentRefreshCount: UINT,
pub SyncRefreshCount: UINT,
pub SyncQPCTime: LARGE_INTEGER,
pub SyncGPUTime: LARGE_INTEGER,
}
#[repr(C)] pub struct DXGI_FRAME_STATISTICS_MEDIA {
pub PresentCount: UINT,
pub PresentRefreshCount: UINT,
pub SyncRefreshCount: UINT,
pub SyncQPCTime: LARGE_INTEGER,
pub SyncGPUTime: LARGE_INTEGER,
pub CompositionMode: DXGI_FRAME_PRESENTATION_MODE,
pub ApprovedPresentDuration: UINT,
}
#[repr(C)] pub struct DXGI_GAMMA_CONTROL {
pub Scale: DXGI_RGB,
pub Offset: DXGI_RGB,
pub GammaCurve: [DXGI_RGB; 1025],
}
#[repr(C)] pub struct DXGI_GAMMA_CONTROL_CAPABILITIES {
pub ScaleAndOffsetSupported: BOOL,
pub MaxConvertedValue: c_float,
pub MinConvertedValue: c_float,
pub NumGammaControlPoints: UINT,
pub ControlPointPositions: [c_float; 1025],
}
#[repr(C)] pub struct DXGI_INFO_QUEUE_FILTER {
pub AllowList: DXGI_INFO_QUEUE_FILTER_DESC,
pub DenyList: DXGI_INFO_QUEUE_FILTER_DESC,
}
#[repr(C)] pub struct DXGI_INFO_QUEUE_FILTER_DESC {
pub NumCategories: UINT,
pub pCategoryList: DXGI_INFO_QUEUE_MESSAGE_CATEGORY,
pub NumSeverities: UINT,
pub pSeverityList: DXGI_INFO_QUEUE_MESSAGE_SEVERITY,
pub NumIDs: UINT,
pub pIDList: DXGI_INFO_QUEUE_MESSAGE_ID,
}
#[repr(C)] pub struct DXGI_INFO_QUEUE_MESSAGE {
pub Producer: DXGI_DEBUG_ID,
pub Category: DXGI_INFO_QUEUE_MESSAGE_CATEGORY,
pub Severity: DXGI_INFO_QUEUE_MESSAGE_SEVERITY,
pub ID: DXGI_INFO_QUEUE_MESSAGE_ID,
pub pDescription: *const c_char,
pub DescriptionByteLength: SIZE_T,
}
#[repr(C)] pub struct DXGI_MATRIX_3X2_F {
pub _11: FLOAT,
pub _12: FLOAT,
pub _21: FLOAT,
pub _22: FLOAT,
pub _31: FLOAT,
pub _32: FLOAT,
}
#[repr(C)] pub struct DXGI_MAPPED_RECT {
pub Pitch: INT,
pub pBits: *mut BYTE,
}
#[repr(C)] pub struct DXGI_MODE_DESC {
pub Width: UINT,
pub Height: UINT,
pub RefreshRate: DXGI_RATIONAL,
pub Format: DXGI_FORMAT,
pub ScanlineOrdering: DXGI_MODE_SCANLINE_ORDER,
pub Scaling: DXGI_MODE_SCALING,
}
#[repr(C)] pub struct DXGI_MODE_DESC1 {
pub Width: UINT,
pub Height: UINT,
pub RefreshRate: DXGI_RATIONAL,
pub Format: DXGI_FORMAT,
pub ScanlineOrdering: DXGI_MODE_SCANLINE_ORDER,
pub Scaling: DXGI_MODE_SCALING,
pub Stereo: BOOL,
}
#[repr(C)] pub struct DXGI_OUTPUT_DESC {
pub DeviceName: [WCHAR; 32],
pub DesktopCoordinates: RECT,
pub AttachedToDesktop: BOOL,
pub Rotation: DXGI_MODE_ROTATION,
pub Monitor: HMONITOR,
}
#[repr(C)] pub struct DXGI_OUTDUPL_DESC {
pub ModeDesc: DXGI_MODE_DESC,
pub Rotation: DXGI_MODE_ROTATION,
pub DesktopImageInSystemMemory: BOOL,
}
#[repr(C)] pub struct DXGI_OUTDUPL_FRAME_INFO {
pub LastPresentTime: LARGE_INTEGER,
pub LastMouseUpdateTime: LARGE_INTEGER,
pub AccumulatedFrames: UINT,
pub RectsCoalesced: BOOL,
pub ProtectedContentMaskedOut: BOOL,
pub PointerPosition: DXGI_OUTDUPL_POINTER_POSITION,
pub TotalMetadataBufferSize: UINT,
pub PointerShapeBufferSize: UINT,
}
#[repr(C)] pub struct DXGI_OUTDUPL_MOVE_RECT {
pub SourcePoint: POINT,
pub DestinationRect: RECT,
}
#[repr(C)] pub struct DXGI_OUTDUPL_POINTER_POSITION {
pub Position: POINT,
pub Visible: BOOL,
}
#[repr(C)] pub struct DXGI_OUTDUPL_POINTER_SHAPE_INFO {
pub Type: UINT,
pub Width: UINT,
pub Height: UINT,
pub Pitch: UINT,
pub HotSpot: POINT,
}
#[repr(C)] pub struct DXGI_PRESENT_PARAMETERS {
pub DirtyRectsCount: UINT,
pub pDirtyRects: RECT,
pub pScrollRect: RECT,
pub pScrollOffset: POINT,
}
#[repr(C)] pub struct DXGI_RATIONAL {
pub Numerator: UINT,
pub Denominator: UINT,
}
#[repr(C)] pub struct DXGI_RGB {
pub Red: c_float,
pub Green: c_float,
pub Blue: c_float,
}
#[repr(C)] pub struct DXGI_RGBA {
pub r: c_float,
pub g: c_float,
pub b: c_float,
pub a: c_float,
}
#[repr(C)] pub struct DXGI_SAMPLE_DESC {
pub Count: UINT,
pub Quality: UINT,
}
#[repr(C)] pub struct DXGI_SHARED_RESOURCE {
pub Handle: HANDLE,
}
#[repr(C)] pub struct DXGI_SURFACE_DESC {
pub Width: UINT,
pub Height: UINT,
pub Format: DXGI_FORMAT,
pub SampleDesc: DXGI_SAMPLE_DESC,
}
#[repr(C)] pub struct DXGI_SWAP_CHAIN_DESC {
pub BufferDesc: DXGI_MODE_DESC,
pub SampleDesc: DXGI_SAMPLE_DESC,
pub BufferUsage: DXGI_USAGE,
pub BufferCount: UINT,
pub OutputWindow: HWND,
pub Windowed: BOOL,
pub SwapEffect: DXGI_SWAP_EFFECT,
pub Flags: UINT,
}
#[repr(C)] pub struct DXGI_SWAP_CHAIN_DESC1 {
pub Width: UINT,
pub Height: UINT,
pub Format: DXGI_FORMAT,
pub Stereo: BOOL,
pub SampleDesc: DXGI_SAMPLE_DESC,
pub BufferUsage: DXGI_USAGE,
pub BufferCount: UINT,
pub Scaling: DXGI_SCALING,
pub SwapEffect: DXGI_SWAP_EFFECT,
pub AlphaMode: DXGI_ALPHA_MODE,
pub Flags: UINT,
}
#[repr(C)] pub struct DXGI_SWAP_CHAIN_FULLSCREEN_DESC {
pub RefreshRate: DXGI_RATIONAL,
pub ScanlineOrdering: DXGI_MODE_SCANLINE_ORDER,
pub Scaling: DXGI_MODE_SCALING,
pub Windowed: BOOL,
}