1 module directx.dxgitype;
2 //
3 //    Copyright (C) Microsoft.  All rights reserved.
4 //
5 
6 public import directx.dxgiformat;
7 
8 import directx.d3dcommon;
9 
10 enum _FACDXGI   = 0x87a;
11 
12 HRESULT MAKE_DXGI_HRESULT(T)(T code) {
13 	return MAKE_HRESULT(1, _FACDXGI, code);
14 }
15 
16 HRESULT MAKE_DXGI_STATUS(T)(T code) {
17 	return MAKE_HRESULT(0, _FACDXGI, code);
18 }
19 
20 // DXGI error messages have moved to winerror.h
21 enum DXGI_STATUS_OCCLUDED                   = MAKE_DXGI_STATUS(1);
22 enum DXGI_STATUS_CLIPPED                    = MAKE_DXGI_STATUS(2);
23 enum DXGI_STATUS_NO_REDIRECTION             = MAKE_DXGI_STATUS(4);
24 enum DXGI_STATUS_NO_DESKTOP_ACCESS          = MAKE_DXGI_STATUS(5);
25 enum DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE = MAKE_DXGI_STATUS(6);
26 enum DXGI_STATUS_MODE_CHANGED               = MAKE_DXGI_STATUS(7);
27 enum DXGI_STATUS_MODE_CHANGE_IN_PROGRESS    = MAKE_DXGI_STATUS(8);
28 
29 enum DXGI_ERROR_INVALID_CALL                = MAKE_DXGI_HRESULT(1);
30 enum DXGI_ERROR_NOT_FOUND                   = MAKE_DXGI_HRESULT(2);
31 enum DXGI_ERROR_MORE_DATA                   = MAKE_DXGI_HRESULT(3);
32 enum DXGI_ERROR_UNSUPPORTED                 = MAKE_DXGI_HRESULT(4);
33 enum DXGI_ERROR_DEVICE_REMOVED              = MAKE_DXGI_HRESULT(5);
34 enum DXGI_ERROR_DEVICE_HUNG                 = MAKE_DXGI_HRESULT(6);
35 enum DXGI_ERROR_DEVICE_RESET                = MAKE_DXGI_HRESULT(7);
36 enum DXGI_ERROR_WAS_STILL_DRAWING           = MAKE_DXGI_HRESULT(10);
37 enum DXGI_ERROR_FRAME_STATISTICS_DISJOINT   = MAKE_DXGI_HRESULT(11);
38 enum DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE = MAKE_DXGI_HRESULT(12);
39 enum DXGI_ERROR_DRIVER_INTERNAL_ERROR       = MAKE_DXGI_HRESULT(32);
40 enum DXGI_ERROR_NONEXCLUSIVE                = MAKE_DXGI_HRESULT(33);
41 enum DXGI_ERROR_NOT_CURRENTLY_AVAILABLE     = MAKE_DXGI_HRESULT(34);
42 enum DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED  = MAKE_DXGI_HRESULT(35);
43 enum DXGI_ERROR_REMOTE_OUTOFMEMORY          = MAKE_DXGI_HRESULT(36);
44 
45 struct DXGI_RGB
46 {
47     float Red;
48     float Green;
49     float Blue;
50 }
51 
52 alias D3DCOLORVALUE DXGI_RGBA;
53 
54 struct DXGI_GAMMA_CONTROL
55 {
56     DXGI_RGB Scale;
57     DXGI_RGB Offset;
58     DXGI_RGB[ 1025 ] GammaCurve;
59 }
60 
61 struct DXGI_GAMMA_CONTROL_CAPABILITIES
62 {
63     int ScaleAndOffsetSupported;
64     float MaxConvertedValue;
65     float MinConvertedValue;
66     uint NumGammaControlPoints;
67     float[1025] ControlPointPositions;
68 }
69 
70 struct DXGI_RATIONAL
71 {
72     uint Numerator;
73     uint Denominator;
74 }
75 
76 alias DXGI_MODE_SCANLINE_ORDER = int;
77 enum : DXGI_MODE_SCANLINE_ORDER
78 {
79     DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED        = 0,
80     DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE        = 1,
81     DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST  = 2,
82     DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST  = 3
83 }
84 
85 alias DXGI_MODE_SCALING = int;
86 enum : DXGI_MODE_SCALING
87 {
88     DXGI_MODE_SCALING_UNSPECIFIED   = 0,
89     DXGI_MODE_SCALING_CENTERED      = 1,
90     DXGI_MODE_SCALING_STRETCHED     = 2
91 }
92 
93 alias DXGI_MODE_ROTATION = int;
94 enum : DXGI_MODE_ROTATION
95 {
96     DXGI_MODE_ROTATION_UNSPECIFIED  = 0,
97     DXGI_MODE_ROTATION_IDENTITY     = 1,
98     DXGI_MODE_ROTATION_ROTATE90     = 2,
99     DXGI_MODE_ROTATION_ROTATE180    = 3,
100     DXGI_MODE_ROTATION_ROTATE270    = 4
101 }
102 
103 struct DXGI_MODE_DESC
104 {
105     uint Width;
106     uint Height;
107     DXGI_RATIONAL RefreshRate;
108     DXGI_FORMAT Format;
109     DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
110     DXGI_MODE_SCALING Scaling;
111 }
112 
113 // The following values are used with DXGI_SAMPLE_DESC::Quality:
114 enum DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN = 0xffffffff;
115 enum DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN   = 0xfffffffe;
116 
117 struct DXGI_SAMPLE_DESC
118 {
119     uint Count;
120     uint Quality;
121 }
122 
123 alias DWORD DXGI_COLOR_SPACE_TYPE;
124 enum : DXGI_COLOR_SPACE_TYPE
125 {
126     DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709             = 0,
127     DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709             = 1,
128     DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709           = 2,
129     DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020          = 3,
130     DXGI_COLOR_SPACE_RESERVED                           = 4,
131     DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601      = 5,
132     DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601         = 6,
133     DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601           = 7,
134     DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709         = 8,
135     DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709           = 9,
136     DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020        = 10,
137     DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020          = 11,
138     DXGI_COLOR_SPACE_CUSTOM                             = 0xFFFFFFFF
139 }
140 
141 struct DXGI_JPEG_DC_HUFFMAN_TABLE
142 {
143     BYTE[12] CodeCounts;
144     BYTE[12] CodeValues;
145 }
146 
147 struct DXGI_JPEG_AC_HUFFMAN_TABLE
148 {
149     BYTE[16] CodeCounts;
150     BYTE[162] CodeValues;
151 }
152 
153 struct DXGI_JPEG_QUANTIZATION_TABLE
154 {
155     BYTE[64] Elements;
156 }