1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! Mappings for the contents of dxgitype.h
7 use shared::d3d9types::D3DCOLORVALUE;
8 use shared::dxgiformat::DXGI_FORMAT;
9 use shared::minwindef::{BOOL, BYTE, DWORD, UINT};
10 pub const DXGI_CPU_ACCESS_NONE: DWORD = 0;
11 pub const DXGI_CPU_ACCESS_DYNAMIC: DWORD = 1;
12 pub const DXGI_CPU_ACCESS_READ_WRITE: DWORD = 2;
13 pub const DXGI_CPU_ACCESS_SCRATCH: DWORD = 3;
14 pub const DXGI_CPU_ACCESS_FIELD: DWORD = 15;
15 ENUM!{enum DXGI_USAGE {
16     DXGI_USAGE_SHADER_INPUT = 1 << (0 + 4),
17     DXGI_USAGE_RENDER_TARGET_OUTPUT = 1 << (1 + 4),
18     DXGI_USAGE_BACK_BUFFER = 1 << (2 + 4),
19     DXGI_USAGE_SHARED = 1 << (3 + 4),
20     DXGI_USAGE_READ_ONLY = 1 << (4 + 4),
21     DXGI_USAGE_DISCARD_ON_PRESENT = 1 << (5 + 4),
22     DXGI_USAGE_UNORDERED_ACCESS = 1 << (6 + 4),
23 }}
24 STRUCT!{struct DXGI_RGB {
25     Red: f32,
26     Green: f32,
27     Blue: f32,
28 }}
29 pub type DXGI_RGBA = D3DCOLORVALUE;
30 STRUCT!{struct DXGI_GAMMA_CONTROL {
31     Scale: DXGI_RGB,
32     Offset: DXGI_RGB,
33     GammaCurve: [DXGI_RGB; 1025],
34 }}
35 STRUCT!{struct DXGI_GAMMA_CONTROL_CAPABILITIES {
36     ScaleAndOffsetSupported: BOOL,
37     MaxConvertedValue: f32,
38     MinConvertedValue: f32,
39     NumGammaControlPoints: UINT,
40     ControlPointPositions: [f32; 1025],
41 }}
42 STRUCT!{struct DXGI_RATIONAL {
43     Numerator: UINT,
44     Denominator: UINT,
45 }}
46 ENUM!{enum DXGI_MODE_SCANLINE_ORDER {
47     DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED,
48     DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE,
49     DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST,
50     DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST,
51 }}
52 ENUM!{enum DXGI_MODE_SCALING {
53     DXGI_MODE_SCALING_UNSPECIFIED,
54     DXGI_MODE_SCALING_CENTERED,
55     DXGI_MODE_SCALING_STRETCHED,
56 }}
57 ENUM!{enum DXGI_MODE_ROTATION {
58     DXGI_MODE_ROTATION_UNSPECIFIED,
59     DXGI_MODE_ROTATION_IDENTITY,
60     DXGI_MODE_ROTATION_ROTATE90,
61     DXGI_MODE_ROTATION_ROTATE180,
62     DXGI_MODE_ROTATION_ROTATE270,
63 }}
64 STRUCT!{struct DXGI_MODE_DESC {
65     Width: UINT,
66     Height: UINT,
67     RefreshRate: DXGI_RATIONAL,
68     Format: DXGI_FORMAT,
69     ScanlineOrdering: DXGI_MODE_SCANLINE_ORDER,
70     Scaling: DXGI_MODE_SCALING,
71 }}
72 STRUCT!{struct DXGI_SAMPLE_DESC {
73     Count: UINT,
74     Quality: UINT,
75 }}
76 STRUCT!{struct DXGI_JPEG_DC_HUFFMAN_TABLE {
77     CodeCounts: [BYTE; 12],
78     CodeValues: [BYTE; 12],
79 }}
80 STRUCT!{struct DXGI_JPEG_AC_HUFFMAN_TABLE {
81     CodeCounts: [BYTE; 16],
82     CodeValues: [BYTE; 162],
83 }}
84 STRUCT!{struct DXGI_JPEG_QUANTIZATION_TABLE {
85     Elements: [BYTE; 64],
86 }}
87 ENUM!{enum DXGI_COLOR_SPACE_TYPE {
88     DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 = 0,
89     DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 = 1,
90     DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 = 2,
91     DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 = 3,
92     DXGI_COLOR_SPACE_RESERVED = 4,
93     DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 = 5,
94     DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 = 6,
95     DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 = 7,
96     DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 = 8,
97     DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 = 9,
98     DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 = 10,
99     DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 = 11,
100     DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 = 12,
101     DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020 = 13,
102     DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020 = 14,
103     DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 = 15,
104     DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 = 16,
105     DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 = 17,
106     DXGI_COLOR_SPACE_CUSTOM = 0xFFFFFFFF,
107 }}
108 pub const DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN: UINT = 0xfffffffe;
109 pub const DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN: UINT = 0xffffffff;
110