├── .gitignore
├── DOPPEngine
├── DOPPEngine.sln
├── DOPPEngine.vcxproj
├── DOPPEngine.vcxproj.filters
├── Shaders
│ ├── base.fp
│ ├── base.vp
│ ├── colorInv.fp
│ ├── distort.fp
│ ├── landscape.fp
│ ├── laplace.fp
│ ├── portrait.fp
│ └── transform.vp
├── res
│ ├── AMDIcon.ico
│ ├── DOPPEngine.rc
│ ├── DOPPEngine.rc2
│ ├── resource.h
│ └── targetver.h
└── src
│ ├── DOPPEngine.cpp
│ ├── DOPPEngine.h
│ ├── DOPPEngineDlg.cpp
│ ├── DOPPEngineDlg.h
│ ├── DOPPRotationDlg.cpp
│ ├── DOPPRotationDlg.h
│ ├── DisplayManager.cpp
│ ├── DisplayManager.h
│ ├── GLDOPPColorInvert.cpp
│ ├── GLDOPPColorInvert.h
│ ├── GLDOPPDistort.cpp
│ ├── GLDOPPDistort.h
│ ├── GLDOPPEdgeFilter.cpp
│ ├── GLDOPPEdgeFilter.h
│ ├── GLDOPPEngine.cpp
│ ├── GLDOPPEngine.h
│ ├── GLDOPPEyefinityLandscape.cpp
│ ├── GLDOPPEyefinityLandscape.h
│ ├── GLDOPPEyefinityPortrait.cpp
│ ├── GLDOPPEyefinityPortrait.h
│ ├── GLDOPPRotate.cpp
│ ├── GLDOPPRotate.h
│ ├── GLShader.cpp
│ ├── GLShader.h
│ ├── stdafx.cpp
│ └── stdafx.h
├── LICENSE.txt
├── README.md
└── external
├── ADL
├── adl_defines.h
├── adl_sdk.h
└── adl_structures.h
└── GLEW
├── include
└── GL
│ ├── glew.h
│ ├── glxew.h
│ └── wglew.h
└── lib
├── Debug
├── Win32
│ └── glew32sd.lib
└── x64
│ └── glew32sd.lib
└── Release
├── Win32
└── glew32s.lib
└── x64
└── glew32s.lib
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, etc.
2 |
3 | # User-specific files
4 | *.suo
5 | *.user
6 |
7 | # Build results
8 | bin/
9 | build/
10 |
11 | # Visual Studo 2015 cache/options directory
12 | .vs/
13 |
14 | # Visual C++ cache files
15 | ipch/
16 | *.aps
17 | *.ncb
18 | *.opensdf
19 | *.sdf
20 | *.db
21 | *.cachefile
22 |
23 | # Visual Studio profiler
24 | *.psess
25 | *.vsp
26 | *.vspx
27 | *.cxlovr
28 |
--------------------------------------------------------------------------------
/DOPPEngine/DOPPEngine.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DOPPEngine", "DOPPEngine.vcxproj", "{7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Debug|x64 = Debug|x64
10 | Release|Win32 = Release|Win32
11 | Release|x64 = Release|x64
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Debug|Win32.ActiveCfg = Debug|Win32
15 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Debug|Win32.Build.0 = Debug|Win32
16 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Debug|Win32.Deploy.0 = Debug|Win32
17 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Debug|x64.ActiveCfg = Debug|x64
18 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Debug|x64.Build.0 = Debug|x64
19 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Debug|x64.Deploy.0 = Debug|x64
20 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Release|Win32.ActiveCfg = Release|Win32
21 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Release|Win32.Build.0 = Release|Win32
22 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Release|Win32.Deploy.0 = Release|Win32
23 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Release|x64.ActiveCfg = Release|x64
24 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Release|x64.Build.0 = Release|x64
25 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}.Release|x64.Deploy.0 = Release|x64
26 | EndGlobalSection
27 | GlobalSection(SolutionProperties) = preSolution
28 | HideSolutionNode = FALSE
29 | EndGlobalSection
30 | EndGlobal
31 |
--------------------------------------------------------------------------------
/DOPPEngine/DOPPEngine.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Debug
10 | x64
11 |
12 |
13 | Release
14 | Win32
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | {7A71FCA5-3DB4-4AF2-84A8-38FF25EECE93}
23 | DOPPEngine
24 | MFCProj
25 |
26 |
27 |
28 | Application
29 | true
30 | Unicode
31 | Dynamic
32 | v110
33 |
34 |
35 | Application
36 | true
37 | Unicode
38 | Dynamic
39 | v110
40 |
41 |
42 | Application
43 | false
44 | true
45 | Unicode
46 | Dynamic
47 | v110
48 |
49 |
50 | Application
51 | false
52 | true
53 | Unicode
54 | Dynamic
55 | v110
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | true
75 | $(ProjectName)
76 | bin/$(PlatformName)/$(Configuration)/
77 | build/$(PlatformName)/$(Configuration)/
78 | false
79 |
80 |
81 | true
82 | $(ProjectName)
83 | bin/$(PlatformName)/$(Configuration)/
84 | build/$(PlatformName)/$(Configuration)/
85 |
86 |
87 | false
88 | $(ProjectName)
89 | bin/$(PlatformName)/$(Configuration)/
90 | build/$(PlatformName)/$(Configuration)/
91 |
92 |
93 | false
94 | $(ProjectName)
95 | bin/$(PlatformName)/$(Configuration)/
96 | build/$(PlatformName)/$(Configuration)/
97 |
98 |
99 |
100 | Use
101 | Level3
102 | Disabled
103 | WIN32;_WINDOWS;_DEBUG;GLEW_STATIC;%(PreprocessorDefinitions)
104 | ../external;../external/GLEW/include;res
105 | false
106 | MultiThreadedDebugDLL
107 |
108 |
109 | Windows
110 | true
111 | glew32sd.lib;OpenGL32.lib; kernel32.lib
112 | ../external/GLEW/lib/$(Configuration)/$(PlatformName)
113 |
114 |
115 | false
116 | true
117 | _DEBUG;%(PreprocessorDefinitions)
118 |
119 |
120 | 0x0409
121 | _DEBUG;%(PreprocessorDefinitions)
122 | $(IntDir);%(AdditionalIncludeDirectories)
123 |
124 |
125 | xcopy "Shaders" "$(OutDir)Shaders/" /f/y
126 |
127 |
128 |
129 |
130 | Use
131 | Level3
132 | Disabled
133 | WIN32;_WINDOWS;_DEBUG;GLEW_STATIC;%(PreprocessorDefinitions)
134 | ../external;../external/GLEW/include;res
135 |
136 |
137 | Windows
138 | true
139 | glew32sd.lib;OpenGL32.lib; kernel32.lib
140 | ../external/GLEW/lib/$(Configuration)/$(PlatformName)
141 |
142 |
143 | false
144 | _DEBUG;%(PreprocessorDefinitions)
145 |
146 |
147 | 0x0409
148 | _DEBUG;%(PreprocessorDefinitions)
149 | $(IntDir);%(AdditionalIncludeDirectories)
150 |
151 |
152 | xcopy "Shaders" "$(OutDir)Shaders/" /f/y
153 |
154 |
155 |
156 |
157 | Level3
158 | Use
159 | MaxSpeed
160 | true
161 | true
162 | WIN32;_WINDOWS;NDEBUG;GLEW_STATIC;%(PreprocessorDefinitions)
163 | ../external;../external/GLEW/include;res
164 |
165 |
166 | Windows
167 | true
168 | true
169 | true
170 | glew32s.lib;OpenGL32.lib; kernel32.lib
171 | ../external/GLEW/lib/$(Configuration)/$(PlatformName)
172 |
173 |
174 | false
175 | true
176 | NDEBUG;%(PreprocessorDefinitions)
177 |
178 |
179 | 0x0409
180 | NDEBUG;%(PreprocessorDefinitions)
181 | $(IntDir);%(AdditionalIncludeDirectories)
182 |
183 |
184 | xcopy "Shaders" "$(OutDir)Shaders/" /f/y
185 |
186 |
187 |
188 |
189 | Level3
190 | Use
191 | MaxSpeed
192 | true
193 | true
194 | WIN32;_WINDOWS;NDEBUG;GLEW_STATIC;%(PreprocessorDefinitions)
195 | ../external;../external/GLEW/include;res
196 |
197 |
198 | Windows
199 | true
200 | true
201 | true
202 | glew32s.lib;OpenGL32.lib; kernel32.lib
203 | ../external/GLEW/lib/$(Configuration)/$(PlatformName)
204 |
205 |
206 | false
207 | NDEBUG;%(PreprocessorDefinitions)
208 |
209 |
210 | 0x0409
211 | NDEBUG;%(PreprocessorDefinitions)
212 | $(IntDir);%(AdditionalIncludeDirectories)
213 |
214 |
215 | xcopy "Shaders" "$(OutDir)Shaders/" /f/y
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 | NotUsing
249 | NotUsing
250 | NotUsing
251 | NotUsing
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 | Create
266 | Create
267 | Create
268 | Create
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
--------------------------------------------------------------------------------
/DOPPEngine/DOPPEngine.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 | {e719dbed-5967-43f8-82ea-776364946d27}
18 |
19 |
20 |
21 |
22 | Resource Files
23 |
24 |
25 | Shaders
26 |
27 |
28 | Shaders
29 |
30 |
31 | Shaders
32 |
33 |
34 | Shaders
35 |
36 |
37 | Shaders
38 |
39 |
40 | Shaders
41 |
42 |
43 | Shaders
44 |
45 |
46 | Shaders
47 |
48 |
49 |
50 |
51 | Header Files
52 |
53 |
54 | Header Files
55 |
56 |
57 | Header Files
58 |
59 |
60 | Header Files
61 |
62 |
63 | Header Files
64 |
65 |
66 | Header Files
67 |
68 |
69 | Header Files
70 |
71 |
72 | Header Files
73 |
74 |
75 | Header Files
76 |
77 |
78 | Header Files
79 |
80 |
81 | Header Files
82 |
83 |
84 | Header Files
85 |
86 |
87 | Header Files
88 |
89 |
90 | Resource Files
91 |
92 |
93 | Resource Files
94 |
95 |
96 |
97 |
98 | Source Files
99 |
100 |
101 | Source Files
102 |
103 |
104 | Source Files
105 |
106 |
107 | Source Files
108 |
109 |
110 | Source Files
111 |
112 |
113 | Source Files
114 |
115 |
116 | Source Files
117 |
118 |
119 | Source Files
120 |
121 |
122 | Source Files
123 |
124 |
125 | Source Files
126 |
127 |
128 | Source Files
129 |
130 |
131 | Source Files
132 |
133 |
134 | Source Files
135 |
136 |
137 |
138 |
139 | Resource Files
140 |
141 |
142 |
143 |
144 | Resource Files
145 |
146 |
147 |
--------------------------------------------------------------------------------
/DOPPEngine/Shaders/base.fp:
--------------------------------------------------------------------------------
1 |
2 | #version 420
3 |
4 | uniform sampler2D baseMap;
5 |
6 | in vec2 Texcoord;
7 |
8 | void main( void )
9 | {
10 | vec4 texColor = texture2D( baseMap, Texcoord );
11 |
12 | gl_FragColor = vec4(texColor.r, texColor.g, texColor.b, texColor.a);
13 | }
--------------------------------------------------------------------------------
/DOPPEngine/Shaders/base.vp:
--------------------------------------------------------------------------------
1 | #version 420
2 |
3 | out vec2 Texcoord;
4 |
5 | void main( void )
6 | {
7 | switch(gl_VertexID)
8 | {
9 | case 0: gl_Position = vec4(-1, -1, 0, 1); Texcoord = vec2(0, 0); break;
10 | case 1: gl_Position = vec4(-1, 3, 0, 1); Texcoord = vec2(0, 2); break;
11 | case 2: gl_Position = vec4(3, -1, 0, 1); Texcoord = vec2(2, 0); break;
12 | }
13 | }
--------------------------------------------------------------------------------
/DOPPEngine/Shaders/colorInv.fp:
--------------------------------------------------------------------------------
1 |
2 | #version 420
3 |
4 | uniform sampler2D baseMap;
5 |
6 | varying vec2 Texcoord;
7 |
8 | void main( void )
9 | {
10 | vec4 texColor = texture2D( baseMap, Texcoord );
11 |
12 | gl_FragColor = vec4(1.0) - vec4(texColor.r, texColor.g, texColor.b, 0.0);
13 | }
--------------------------------------------------------------------------------
/DOPPEngine/Shaders/distort.fp:
--------------------------------------------------------------------------------
1 | #version 420
2 |
3 | uniform float fTime;
4 | uniform sampler2D baseMap;
5 |
6 | varying vec2 Texcoord;
7 |
8 | void main( void )
9 | {
10 | float d;
11 | ivec2 texSize = textureSize(baseMap, 0);
12 |
13 | d = distance(texSize/2.0, vec2(gl_FragCoord.x, gl_FragCoord.y));
14 |
15 | float s = sin(d/(texSize.x/8.0)) * sin(fTime)/10.0;
16 |
17 | gl_FragColor = texture2D( baseMap, vec2(Texcoord.s + s, Texcoord.t) );
18 |
19 |
20 | }
--------------------------------------------------------------------------------
/DOPPEngine/Shaders/landscape.fp:
--------------------------------------------------------------------------------
1 |
2 | #version 420
3 |
4 | uniform sampler2D baseMap;
5 |
6 | varying vec2 Texcoord;
7 |
8 | void main( void )
9 | {
10 | vec2 tex = Texcoord;
11 |
12 | if (tex.y < 0.5)
13 | {
14 | tex.x = 1.0 - tex.x;
15 | tex.y = 0.5 - tex.y;
16 | }
17 |
18 | vec4 texColor = texture2D( baseMap, tex );
19 |
20 | gl_FragColor = vec4(texColor.r, texColor.g, texColor.b, 0.0);
21 | }
--------------------------------------------------------------------------------
/DOPPEngine/Shaders/laplace.fp:
--------------------------------------------------------------------------------
1 |
2 | #version 420
3 |
4 | uniform sampler2D baseMap;
5 | varying vec2 Texcoord;
6 |
7 | void main(void)
8 | {
9 | float scale = 4.0;
10 | vec4 laplace;
11 | vec2 samples0,samples1,samples2,samples3;
12 | ivec2 texSize = textureSize(baseMap, 0);
13 |
14 | float pixelSize_S = 1.0f/ texSize.s;
15 | float pixelSize_T = 1.0f/ texSize.t;
16 |
17 |
18 | samples0 = Texcoord + pixelSize_T *vec2( 0.0, -1.0);
19 | samples1 = Texcoord + pixelSize_S *vec2(-1.0, 0.0);
20 | samples2 = Texcoord + pixelSize_S *vec2( 1.0, 0.0);
21 | samples3 = Texcoord + pixelSize_T *vec2( 0.0, 1.0);
22 |
23 |
24 | laplace = -4.0 * texture2D(baseMap, Texcoord);
25 | laplace += texture2D(baseMap, samples0);
26 | laplace += texture2D(baseMap, samples1);
27 | laplace += texture2D(baseMap, samples2);
28 | laplace += texture2D(baseMap, samples3);
29 |
30 |
31 | gl_FragColor = 1.0 - scale * laplace;
32 |
33 | }
--------------------------------------------------------------------------------
/DOPPEngine/Shaders/portrait.fp:
--------------------------------------------------------------------------------
1 |
2 | #version 420
3 |
4 | uniform sampler2D baseMap;
5 |
6 | varying vec2 Texcoord;
7 |
8 | void main( void )
9 | {
10 | vec2 tex = Texcoord;
11 |
12 | if (tex.x < 0.5)
13 | {
14 | tex.x = 0.5 - tex.x;
15 | tex.y = 1.0 - tex.y;
16 | }
17 |
18 | vec4 texColor = texture2D( baseMap, tex );
19 |
20 | gl_FragColor = vec4(texColor.r, texColor.g, texColor.b, 0.0);
21 | }
--------------------------------------------------------------------------------
/DOPPEngine/Shaders/transform.vp:
--------------------------------------------------------------------------------
1 |
2 | #version 420
3 |
4 | layout(shared, binding = 0) uniform FrameData
5 | {
6 | mat4 ModelViewMat;
7 | mat4 ProjectionMat;
8 | };
9 |
10 | out vec2 Texcoord;
11 |
12 |
13 | void main()
14 | {
15 | vec4 position;
16 |
17 | switch(gl_VertexID)
18 | {
19 | case 0: position = vec4(-1, -1, 0, 1); Texcoord = vec2(0, 0); break;
20 | case 1: position = vec4(-1, 3, 0, 1); Texcoord = vec2(0, 2); break;
21 | case 2: position = vec4(3, -1, 0, 1); Texcoord = vec2(2, 0); break;
22 | }
23 |
24 | gl_Position = ProjectionMat * ModelViewMat * position;
25 | }
--------------------------------------------------------------------------------
/DOPPEngine/res/AMDIcon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPPEngine/4f981624595f994619d67fb8ebbc2618c116e8a4/DOPPEngine/res/AMDIcon.ico
--------------------------------------------------------------------------------
/DOPPEngine/res/DOPPEngine.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPPEngine/4f981624595f994619d67fb8ebbc2618c116e8a4/DOPPEngine/res/DOPPEngine.rc
--------------------------------------------------------------------------------
/DOPPEngine/res/DOPPEngine.rc2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPPEngine/4f981624595f994619d67fb8ebbc2618c116e8a4/DOPPEngine/res/DOPPEngine.rc2
--------------------------------------------------------------------------------
/DOPPEngine/res/resource.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPPEngine/4f981624595f994619d67fb8ebbc2618c116e8a4/DOPPEngine/res/resource.h
--------------------------------------------------------------------------------
/DOPPEngine/res/targetver.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // Including SDKDDKVer.h defines the highest available Windows platform.
4 |
5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
7 |
8 | #include
9 |
--------------------------------------------------------------------------------
/DOPPEngine/src/DOPPEngine.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "stdafx.h"
24 |
25 | #include "DOPPEngine.h"
26 | #include "DOPPEngineDlg.h"
27 |
28 |
29 | BEGIN_MESSAGE_MAP(CDOPPEngineApp, CWinApp)
30 | ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
31 | END_MESSAGE_MAP()
32 |
33 |
34 | CDOPPEngineApp theApp;
35 |
36 |
37 | CDOPPEngineApp::CDOPPEngineApp()
38 | {
39 | // Support Restart Manager
40 | m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
41 | }
42 |
43 |
44 | BOOL CDOPPEngineApp::InitInstance()
45 | {
46 | CWinApp::InitInstance();
47 |
48 | CDOPPEngineDlg dlg;
49 | m_pMainWnd = &dlg;
50 | INT_PTR nResponse = dlg.DoModal();
51 |
52 | return FALSE;
53 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/DOPPEngine.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | #ifndef __AFXWIN_H__
26 | #error "include 'stdafx.h' before including this file for PCH"
27 | #endif
28 |
29 | #include "..\res\resource.h"
30 |
31 | class CDOPPEngineApp : public CWinApp
32 | {
33 | public:
34 | CDOPPEngineApp();
35 |
36 | public:
37 | virtual BOOL InitInstance();
38 |
39 | DECLARE_MESSAGE_MAP()
40 | };
41 |
42 | extern CDOPPEngineApp theApp;
--------------------------------------------------------------------------------
/DOPPEngine/src/DOPPEngineDlg.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "stdafx.h"
24 | #include
25 |
26 | #include
27 | #include
28 |
29 | #include "afxdialogex.h"
30 | #include "DisplayManager.h"
31 | #include "DOPPEngine.h"
32 | #include "DOPPEngineDlg.h"
33 | #include "DOPPRotationDlg.h"
34 |
35 | #include "GLDOPPColorInvert.h"
36 | #include "GLDOPPDistort.h"
37 | #include "GLDOPPEdgeFilter.h"
38 | #include "GLDOPPEngine.h"
39 | #include "GLDOPPEyefinityLandscape.h"
40 | #include "GLDOPPEyefinityPortrait.h"
41 | #include "GLDOPPRotate.h"
42 |
43 | #define TITLE L"DOPP Engine v 0.3"
44 |
45 | static unsigned int g_uiWindowWidth = 800;
46 | static unsigned int g_uiWindowHeight = 600;
47 |
48 | using namespace std;
49 |
50 |
51 | LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
52 |
53 | void MyDebugFunc(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam)
54 | {
55 | MessageBoxA(NULL, message, "GL Debug Message", MB_ICONWARNING | MB_OK);
56 | }
57 |
58 |
59 | CDOPPEngineDlg::CDOPPEngineDlg(CWnd* pParent)
60 | : CDialogEx(CDOPPEngineDlg::IDD, pParent)
61 | , m_pThreads(nullptr)
62 | , m_pThreadData(nullptr)
63 | , m_bEngineRunning(false)
64 | , m_bShowCaptureWin(false)
65 | , m_bBlockingPrsent(false)
66 | , m_pEffectComboBox(nullptr)
67 | , m_pShowWinCheckBox(nullptr)
68 | , m_pDesktopListBox(nullptr)
69 | , m_uiEffectSelection(0)
70 | , m_uiNumSelectedDesktops(0)
71 | , m_pDisplayManager(nullptr)
72 | , m_pRotationDlg(nullptr)
73 | {
74 | m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
75 | }
76 |
77 |
78 | CDOPPEngineDlg::~CDOPPEngineDlg()
79 | {
80 | if (m_pDisplayManager)
81 | {
82 | delete m_pDisplayManager;
83 | m_pDisplayManager = nullptr;
84 | }
85 |
86 | if (m_pRotationDlg)
87 | {
88 | delete m_pRotationDlg;
89 | m_pRotationDlg = nullptr;
90 | }
91 |
92 | if (m_pThreads)
93 | {
94 | delete[] m_pThreads;
95 | m_pThreads = nullptr;
96 | }
97 |
98 | if (m_pThreadData)
99 | {
100 | delete[] m_pThreadData;
101 | m_pThreadData = nullptr;
102 | }
103 | }
104 |
105 |
106 | void CDOPPEngineDlg::DoDataExchange(CDataExchange* pDX)
107 | {
108 | CDialogEx::DoDataExchange(pDX);
109 | }
110 |
111 |
112 | BEGIN_MESSAGE_MAP(CDOPPEngineDlg, CDialogEx)
113 | ON_WM_PAINT()
114 | ON_WM_QUERYDRAGICON()
115 | ON_COMMAND(IDC_START, &CDOPPEngineDlg::OnStart)
116 | ON_COMMAND(IDC_STOP, &CDOPPEngineDlg::OnStop)
117 | ON_COMMAND(IDC_EXIT, &CDOPPEngineDlg::OnExit)
118 | END_MESSAGE_MAP()
119 |
120 |
121 | BOOL CDOPPEngineDlg::OnInitDialog()
122 | {
123 | CDialogEx::OnInitDialog();
124 |
125 | SetWindowText(TITLE);
126 |
127 | SetIcon(m_hIcon, TRUE);
128 | SetIcon(m_hIcon, FALSE);
129 |
130 | m_pEffectComboBox = static_cast(GetDlgItem(IDC_COMBO_EFFECT));
131 |
132 | m_pEffectComboBox->Clear();
133 | m_pEffectComboBox->InsertString(NO_EFFECT, _T("No Effect"));
134 | m_pEffectComboBox->InsertString(COLOR_INVERT, _T("Invert Colors"));
135 | m_pEffectComboBox->InsertString(EDGE_FILTER, _T("Edge Filter"));
136 | m_pEffectComboBox->InsertString(DISTORT_EFFECT, _T("Distort"));
137 | m_pEffectComboBox->InsertString(ROTATE_DESKTOP, _T("Rotate"));
138 | m_pEffectComboBox->InsertString(EYEFINITY_LANDSCAPE, _T("Eyefinity Landscape"));
139 | m_pEffectComboBox->InsertString(EYEFINITY_PORTRAIT, _T("Eyefinity Portrait"));
140 |
141 | m_pEffectComboBox->SetCurSel(0);
142 | m_uiEffectSelection = 0;
143 |
144 | m_pDisplayManager = new DisplayManager;
145 |
146 | m_pShowWinCheckBox = static_cast(GetDlgItem(IDC_CHECK_WINDOW));
147 | m_pShowWinCheckBox->SetCheck(BST_UNCHECKED);
148 |
149 | m_pBlockingPresentBox = static_cast(GetDlgItem(IDC_CHECK_BLOCK));
150 | m_pBlockingPresentBox->SetCheck(BST_UNCHECKED);
151 |
152 | m_pDesktopListBox = static_cast(GetDlgItem(IDC_LIST_DESKTOP));
153 |
154 | unsigned int uiNumDesktops = m_pDisplayManager->enumDisplays();
155 |
156 | for (unsigned int i = 0; i < uiNumDesktops; ++i)
157 | {
158 | char buf[64];
159 |
160 | // Add 1 to the id to have the matching Desktop Id with CCC
161 | sprintf_s(buf, " Desktop %d on GPU %d", (i + 1), m_pDisplayManager->getGpuId(i));
162 |
163 | m_pDesktopListBox->InsertString(i, CA2CT(buf));
164 | }
165 |
166 | m_pDesktopListBox->SetCurSel(0);
167 |
168 | m_uiNumSelectedDesktops = 0;
169 |
170 | m_pRotationDlg = new DOPPRotationDlg;
171 |
172 | return TRUE;
173 | }
174 |
175 |
176 | void CDOPPEngineDlg::OnPaint()
177 | {
178 | if (IsIconic())
179 | {
180 | CPaintDC dc(this);
181 |
182 | SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0);
183 |
184 | int cxIcon = GetSystemMetrics(SM_CXICON);
185 | int cyIcon = GetSystemMetrics(SM_CYICON);
186 | CRect rect;
187 | GetClientRect(&rect);
188 | int x = (rect.Width() - cxIcon + 1) / 2;
189 | int y = (rect.Height() - cyIcon + 1) / 2;
190 |
191 | dc.DrawIcon(x, y, m_hIcon);
192 | }
193 | else
194 | {
195 | CDialogEx::OnPaint();
196 | }
197 | }
198 |
199 |
200 | HCURSOR CDOPPEngineDlg::OnQueryDragIcon()
201 | {
202 | return static_cast(m_hIcon);
203 | }
204 |
205 |
206 | void CDOPPEngineDlg::OnStart()
207 | {
208 | if (!m_bEngineRunning)
209 | {
210 | m_uiEffectSelection = m_pEffectComboBox->GetCurSel();
211 | m_uiNumSelectedDesktops = m_pDesktopListBox->GetSelCount();
212 |
213 | // Clean thread data for the case that the engine ended with an error and OnStop was not called.
214 | if (m_pThreadData)
215 | {
216 | delete[] m_pThreadData;
217 | m_pThreadData = nullptr;
218 | }
219 |
220 | if (m_pThreads)
221 | {
222 | delete[] m_pThreads;
223 | m_pThreads = nullptr;
224 | }
225 |
226 | // check if the selected desktops are on different GPUs
227 | unsigned int uiNumGpuInSystem = m_pDisplayManager->getNumGPUs();
228 |
229 | bool* pGpuIsFree = new bool[uiNumGpuInSystem];
230 |
231 | bool bValidSelection = true;
232 |
233 | memset(pGpuIsFree, 1, uiNumGpuInSystem * sizeof(bool));
234 |
235 | for (int i = 0, iEnd = m_pDesktopListBox->GetCount(); i < iEnd; ++i)
236 | {
237 | if (m_pDesktopListBox->GetSel(i))
238 | {
239 | unsigned int uiGPU = m_pDisplayManager->getGpuId(i);
240 |
241 | if (pGpuIsFree[uiGPU])
242 | {
243 | pGpuIsFree[uiGPU] = false;
244 | }
245 | else
246 | {
247 | MessageBox(L"More than one desktop on the same GPU is selected!", L"DOPP Error", MB_ICONERROR | MB_OK);
248 | bValidSelection = false;
249 | }
250 | }
251 | }
252 |
253 | delete[] pGpuIsFree;
254 |
255 | if (bValidSelection && m_uiNumSelectedDesktops > 0)
256 | {
257 | auto numDisplays = m_pDisplayManager->getNumDisplays();
258 | m_pThreads = new HANDLE[numDisplays];
259 | m_pThreadData = new THREAD_DATA[numDisplays];
260 |
261 | memset(m_pThreads, 0, sizeof(HANDLE) * numDisplays);
262 | memset(m_pThreadData, 0, sizeof(THREAD_DATA) * numDisplays);
263 |
264 | if (m_uiEffectSelection == ROTATE_DESKTOP && m_pRotationDlg)
265 | {
266 | if (m_pRotationDlg->DoModal() == IDOK)
267 | {
268 | m_uiRotationAngle = m_pRotationDlg->getAngle();
269 | }
270 | else
271 | {
272 | return;
273 | }
274 | }
275 |
276 | m_bShowCaptureWin = (m_pShowWinCheckBox->GetCheck() == BST_CHECKED);
277 | m_bBlockingPrsent = (m_pBlockingPresentBox->GetCheck() == BST_CHECKED);
278 |
279 | InitializeCriticalSection(&m_CriticalSection);
280 |
281 | // Loop through all entries of the listbox and start a thread for each selected
282 | m_bEngineRunning = true;
283 |
284 | unsigned int uiSel = 0;
285 |
286 | for (int i = 0, iEnd = m_pDesktopListBox->GetCount(); i < iEnd; ++i)
287 | {
288 | if (m_pDesktopListBox->GetSel(i) > 0)
289 | {
290 | m_pThreadData[uiSel].pDoppEngine = this;
291 | m_pThreadData[uiSel].uiDesktop = i;
292 | m_pThreads[uiSel] = CreateThread(nullptr, 0, reinterpret_cast(&CDOPPEngineDlg::threadFunction), &m_pThreadData[uiSel], 0, &m_pThreadData[uiSel].dwThreadId);
293 |
294 | ++uiSel;
295 | }
296 | }
297 | }
298 | }
299 | }
300 |
301 |
302 | void CDOPPEngineDlg::OnStop()
303 | {
304 | if (m_bEngineRunning)
305 | {
306 | m_bEngineRunning = false;
307 |
308 | WaitForMultipleObjects(m_uiNumSelectedDesktops, m_pThreads, true, INFINITE);
309 |
310 | DeleteCriticalSection(&m_CriticalSection);
311 |
312 | if (m_pThreadData)
313 | {
314 | delete[] m_pThreadData;
315 | m_pThreadData = nullptr;
316 | }
317 |
318 | if (m_pThreads)
319 | {
320 | delete[] m_pThreads;
321 | m_pThreads = nullptr;
322 | }
323 | }
324 | }
325 |
326 |
327 | void CDOPPEngineDlg::OnExit()
328 | {
329 | OnStop();
330 | OnOK();
331 | }
332 |
333 |
334 | DWORD CDOPPEngineDlg::threadFunction(void* pData)
335 | {
336 | if (pData)
337 | {
338 | THREAD_DATA* pThreadData = reinterpret_cast(pData);
339 |
340 | pThreadData->pDoppEngine->threadLoop(pThreadData->uiDesktop);
341 | }
342 |
343 | return 0;
344 | }
345 |
346 |
347 | DWORD CDOPPEngineDlg::threadLoop(unsigned int uiDesktop)
348 | {
349 | THREAD_DATA* pMyData = &m_pThreadData[uiDesktop];
350 |
351 | GLDOPPEngine* pEngine = nullptr;
352 |
353 | switch (m_uiEffectSelection)
354 | {
355 | case COLOR_INVERT:
356 | pEngine = new GLDOPPColorInvert;
357 | break;
358 |
359 | case EDGE_FILTER:
360 | pEngine = new GLDOPPEdgeFilter;
361 | break;
362 |
363 | case DISTORT_EFFECT:
364 | pEngine = new GLDOPPDistort;
365 | break;
366 |
367 | case ROTATE_DESKTOP:
368 | pEngine = new GLDOPPRotate;
369 | break;
370 |
371 | case EYEFINITY_LANDSCAPE:
372 | pEngine = new GLDOPPEyefinityLandscape;
373 | break;
374 |
375 | case EYEFINITY_PORTRAIT:
376 | pEngine = new GLDOPPEyefinityPortrait;
377 | break;
378 |
379 | default:
380 | pEngine = new GLDOPPEngine;
381 | break;
382 | }
383 |
384 | // Enter critical section to make sure if init fails the subsequent
385 | // threads won't attempt to init again.
386 | EnterCriticalSection(&m_CriticalSection);
387 |
388 | wchar_t wcClassname[16];
389 | swprintf_s(wcClassname, L"OGL%d", pMyData->uiDesktop);
390 |
391 | // Create window with ogl context to load extensions
392 | if (m_bEngineRunning && !createGLWindow(uiDesktop, wcClassname))
393 | {
394 | m_bEngineRunning = false;
395 | MessageBox(L"Failed to create GL window!", L"GL Error", MB_ICONERROR | MB_OK);
396 | }
397 |
398 | // m_uiDesktopSelection is the id of the selected element in the Combo Box
399 | // Need to add 1 to get the dektop id as shown in CCC
400 | if (m_bEngineRunning && !pEngine->initDOPP(uiDesktop + 1))
401 | {
402 | m_bEngineRunning = false;
403 | MessageBox(L"Failed to initialize DOPP!", L"DOPP Error", MB_ICONERROR | MB_OK);
404 | }
405 |
406 | if (m_bEngineRunning && !pEngine->initEffect())
407 | {
408 | m_bEngineRunning = false;
409 | MessageBox(L"Failed to initialize DOPP Shaders!", L"DOPP Error", MB_ICONERROR | MB_OK);
410 | }
411 |
412 | LeaveCriticalSection(&m_CriticalSection);
413 |
414 | if (m_bEngineRunning && m_bShowCaptureWin)
415 | {
416 | // Create off screen context
417 | showWindow(uiDesktop);
418 | }
419 |
420 | if (m_bEngineRunning && m_uiEffectSelection == ROTATE_DESKTOP)
421 | {
422 | GLDOPPRotate* pRot = dynamic_cast(pEngine);
423 |
424 | pRot->setRotation(static_cast(m_uiRotationAngle));
425 | }
426 |
427 | MSG mMsg;
428 |
429 | while (m_bEngineRunning)
430 | {
431 | pEngine->processDesktop(m_bBlockingPrsent);
432 |
433 | if (m_bShowCaptureWin)
434 | {
435 | // Blit FBO of DOPPEngine into the window
436 | glViewport(0, 0, g_uiWindowWidth, g_uiWindowHeight);
437 |
438 | unsigned int uiFBO = pEngine->getPresentBuffer();
439 |
440 | glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
441 | glBindFramebuffer(GL_READ_FRAMEBUFFER, uiFBO);
442 |
443 | glBlitFramebuffer(0, pEngine->getDesktopHeight(), pEngine->getDesktopWidth(), 0, 0, 0, g_uiWindowWidth, g_uiWindowHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR);
444 |
445 | glBindFramebuffer(GL_FRAMEBUFFER, 0);
446 |
447 | SwapBuffers(pMyData->hDC);
448 |
449 | while (PeekMessage(&mMsg, NULL, 0, 0, PM_REMOVE) && mMsg.message != WM_QUIT)
450 | {
451 | TranslateMessage(&mMsg);
452 | DispatchMessage(&mMsg);
453 | }
454 |
455 | if (mMsg.message == WM_QUIT)
456 | {
457 | m_bEngineRunning = false;
458 | }
459 | }
460 | }
461 |
462 | delete pEngine;
463 |
464 | EnterCriticalSection(&m_CriticalSection);
465 |
466 | deleteWindow(uiDesktop, wcClassname);
467 |
468 | LeaveCriticalSection(&m_CriticalSection);
469 |
470 | return 0;
471 | }
472 |
473 |
474 | bool CDOPPEngineDlg::createGLWindow(unsigned int id, wchar_t* lpClassName)
475 | {
476 | int mPixelFormat;
477 |
478 | WNDCLASSEX wndclass = {};
479 |
480 | wndclass.cbSize = sizeof(WNDCLASSEX);
481 | wndclass.style = CS_OWNDC;
482 | wndclass.lpfnWndProc = WndProc;
483 | wndclass.hInstance = static_cast(GetModuleHandle(NULL));
484 | wndclass.hIcon = static_cast(LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, LR_DEFAULTSIZE, LR_DEFAULTSIZE, NULL));
485 | wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
486 | wndclass.lpszClassName = lpClassName;
487 | wndclass.hIconSm = static_cast(LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, LR_DEFAULTSIZE, LR_DEFAULTSIZE, NULL));
488 |
489 | if (!RegisterClassEx(&wndclass))
490 | {
491 | return FALSE;
492 | }
493 |
494 | DWORD dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
495 | DWORD dwStyle = WS_OVERLAPPEDWINDOW;
496 |
497 | int nOriginX;
498 | int nOriginY;
499 |
500 | if (!m_pDisplayManager->getOrigin(id, nOriginX, nOriginY))
501 | {
502 | nOriginX = 0;
503 | nOriginY = 0;
504 | }
505 |
506 | wchar_t wcWindowName[32];
507 | swprintf_s(wcWindowName, L"Desktop %d", id);
508 |
509 | m_pThreadData[id].hWnd = CreateWindow(lpClassName,
510 | wcWindowName,
511 | dwStyle,
512 | nOriginX,
513 | nOriginY,
514 | g_uiWindowWidth,
515 | g_uiWindowHeight,
516 | NULL,
517 | NULL,
518 | static_cast(AfxGetInstanceHandle()),
519 | nullptr);
520 |
521 | if (!m_pThreadData[id].hWnd)
522 | {
523 | return FALSE;
524 | }
525 |
526 | static PIXELFORMATDESCRIPTOR pfd = {};
527 |
528 | pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
529 | pfd.nVersion = 1;
530 | pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
531 | pfd.iPixelType = PFD_TYPE_RGBA;
532 | pfd.cColorBits = 24;
533 | pfd.cRedBits = 8;
534 | pfd.cGreenBits = 8;
535 | pfd.cBlueBits = 8;
536 | pfd.cAlphaBits = 8;
537 | pfd.cDepthBits = 24;
538 | pfd.cStencilBits = 8;
539 | pfd.iLayerType = PFD_MAIN_PLANE;
540 |
541 | m_pThreadData[id].hDC = ::GetDC(m_pThreadData[id].hWnd);
542 |
543 | if (!m_pThreadData[id].hDC)
544 | {
545 | return FALSE;
546 | }
547 |
548 | mPixelFormat = ChoosePixelFormat(m_pThreadData[id].hDC, &pfd);
549 |
550 | if (!mPixelFormat)
551 | {
552 | return FALSE;
553 | }
554 |
555 | SetPixelFormat(m_pThreadData[id].hDC, mPixelFormat, &pfd);
556 |
557 | m_pThreadData[id].hCtx = wglCreateContext(m_pThreadData[id].hDC);
558 |
559 | wglMakeCurrent(m_pThreadData[id].hDC, m_pThreadData[id].hCtx);
560 |
561 | if (glewInit() != GLEW_OK)
562 | {
563 | return false;
564 | }
565 |
566 | if (WGLEW_ARB_create_context)
567 | {
568 | wglMakeCurrent(NULL, NULL);
569 | wglDeleteContext(m_pThreadData[id].hCtx);
570 |
571 | int attribs[] = { WGL_CONTEXT_MAJOR_VERSION_ARB, 4,
572 | WGL_CONTEXT_MINOR_VERSION_ARB, 2,
573 | WGL_CONTEXT_PROFILE_MASK_ARB , WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
574 | #ifdef _DEBUG
575 | WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_DEBUG_BIT_ARB,
576 | #endif
577 | 0 };
578 |
579 | m_pThreadData[id].hCtx = wglCreateContextAttribsARB(m_pThreadData[id].hDC, 0, attribs);
580 |
581 | if (m_pThreadData[id].hCtx)
582 | {
583 | wglMakeCurrent(m_pThreadData[id].hDC, m_pThreadData[id].hCtx);
584 | }
585 | else
586 | {
587 | return false;
588 | }
589 | }
590 |
591 | if (!wglMakeCurrent(m_pThreadData[id].hDC, m_pThreadData[id].hCtx))
592 | {
593 | return false;
594 | }
595 |
596 | if (GLEW_AMD_debug_output)
597 | {
598 | glDebugMessageCallbackAMD(reinterpret_cast(&MyDebugFunc), nullptr);
599 | }
600 |
601 | return true;
602 | }
603 |
604 |
605 | void CDOPPEngineDlg::showWindow(unsigned int id)
606 | {
607 | ::ShowWindow(m_pThreadData[id].hWnd, SW_SHOW);
608 |
609 | ::UpdateWindow(m_pThreadData[id].hWnd);
610 | }
611 |
612 |
613 | void CDOPPEngineDlg::deleteWindow(unsigned int id, wchar_t* lpClassName)
614 | {
615 | if (m_pThreadData[id].hDC && m_pThreadData[id].hCtx)
616 | {
617 | wglMakeCurrent(m_pThreadData[id].hDC, NULL);
618 | wglDeleteContext(m_pThreadData[id].hCtx);
619 | }
620 |
621 | if (m_pThreadData[id].hDC && m_pThreadData[id].hWnd)
622 | {
623 | ::ReleaseDC(m_pThreadData[id].hWnd, m_pThreadData[id].hDC);
624 | ::DestroyWindow(m_pThreadData[id].hWnd);
625 | }
626 |
627 | ::UnregisterClass(lpClassName, NULL);
628 | }
629 |
630 |
631 | LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
632 | {
633 | switch (uMsg)
634 | {
635 | case WM_CHAR:
636 | if (wParam == VK_ESCAPE)
637 | {
638 | PostQuitMessage(0);
639 | }
640 | return 0;
641 |
642 | case WM_CREATE:
643 | return 0;
644 |
645 | case WM_SIZE:
646 | g_uiWindowWidth = LOWORD(lParam);
647 | g_uiWindowHeight = HIWORD(lParam);
648 | return 0;
649 |
650 | case WM_DESTROY:
651 | PostQuitMessage(0);
652 | return 0;
653 |
654 | }
655 |
656 | return DefWindowProc(hWnd, uMsg, wParam, lParam);
657 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/DOPPEngineDlg.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | class DisplayManager;
26 | class DOPPRotationDlg;
27 |
28 | class CDOPPEngineDlg : public CDialogEx
29 | {
30 | public:
31 | CDOPPEngineDlg(CWnd* pParent = nullptr);
32 | ~CDOPPEngineDlg();
33 |
34 | enum { IDD = IDD_DOPPENGINE_DIALOG };
35 |
36 | protected:
37 | virtual void DoDataExchange(CDataExchange* pDX);
38 |
39 | protected:
40 | HICON m_hIcon;
41 |
42 | virtual BOOL OnInitDialog();
43 | afx_msg void OnPaint();
44 | afx_msg HCURSOR OnQueryDragIcon();
45 | afx_msg void OnStart();
46 | afx_msg void OnStop();
47 | afx_msg void OnExit();
48 |
49 | DECLARE_MESSAGE_MAP()
50 |
51 | private:
52 |
53 | enum EffectId { NO_EFFECT, COLOR_INVERT, EDGE_FILTER, DISTORT_EFFECT, ROTATE_DESKTOP, EYEFINITY_LANDSCAPE, EYEFINITY_PORTRAIT };
54 |
55 | struct THREAD_DATA
56 | {
57 | CDOPPEngineDlg* pDoppEngine;
58 | DWORD dwThreadId;
59 | unsigned int uiDesktop;
60 | HWND hWnd;
61 | HDC hDC;
62 | HGLRC hCtx;
63 | };
64 |
65 | bool createGLWindow(unsigned int id, wchar_t* pClassName);
66 | void showWindow(unsigned int id);
67 | void deleteWindow(unsigned int id, wchar_t* pClassName);
68 |
69 | static DWORD threadFunction(void* pData);
70 | DWORD threadLoop(unsigned int uiDesktop);
71 |
72 | bool m_bEngineRunning;
73 | bool m_bShowCaptureWin;
74 | bool m_bBlockingPrsent;
75 |
76 | unsigned int m_uiNumSelectedDesktops;
77 | unsigned int m_uiEffectSelection;
78 | unsigned int m_uiRotationAngle;
79 |
80 | CComboBox* m_pEffectComboBox;
81 | CListBox* m_pDesktopListBox;
82 | CButton* m_pShowWinCheckBox;
83 | CButton* m_pBlockingPresentBox;
84 |
85 | DisplayManager* m_pDisplayManager;
86 |
87 | DOPPRotationDlg* m_pRotationDlg;
88 |
89 | HANDLE* m_pThreads;
90 | struct THREAD_DATA* m_pThreadData;
91 |
92 | CRITICAL_SECTION m_CriticalSection;
93 | };
--------------------------------------------------------------------------------
/DOPPEngine/src/DOPPRotationDlg.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "stdafx.h"
24 | #include "afxdialogex.h"
25 |
26 | #include "DOPPEngine.h"
27 | #include "DOPPRotationDlg.h"
28 |
29 |
30 | IMPLEMENT_DYNAMIC(DOPPRotationDlg, CDialogEx)
31 |
32 |
33 | DOPPRotationDlg::DOPPRotationDlg(CWnd* pParent)
34 | : CDialogEx(DOPPRotationDlg::IDD, pParent)
35 | , m_pSlider(nullptr)
36 | , m_pSliderValue(nullptr)
37 | , m_uiAngle(0)
38 | {}
39 |
40 |
41 | DOPPRotationDlg::~DOPPRotationDlg()
42 | {}
43 |
44 |
45 | void DOPPRotationDlg::DoDataExchange(CDataExchange* pDX)
46 | {
47 | CDialogEx::DoDataExchange(pDX);
48 | }
49 |
50 |
51 | BEGIN_MESSAGE_MAP(DOPPRotationDlg, CDialogEx)
52 | ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER_ANGLE, &DOPPRotationDlg::OnNMCustomdrawSliderAngle)
53 | ON_BN_CLICKED(IDOK, &DOPPRotationDlg::OnBnClickedOk)
54 | ON_BN_CLICKED(IDCANCLE, &DOPPRotationDlg::OnBnClickedCancle)
55 | END_MESSAGE_MAP()
56 |
57 |
58 | void DOPPRotationDlg::OnNMCustomdrawSliderAngle(NMHDR* pNMHDR, LRESULT* pResult)
59 | {
60 | m_uiAngle = m_pSlider->GetPos();
61 |
62 | char buf[8];
63 | sprintf_s(buf, " %d", m_uiAngle);
64 |
65 | m_pSliderValue->SetWindowTextW(CA2CT(buf));
66 | }
67 |
68 |
69 | BOOL DOPPRotationDlg::OnInitDialog()
70 | {
71 | m_pSlider = static_cast(GetDlgItem(IDC_SLIDER_ANGLE));
72 |
73 | m_pSliderValue = static_cast(GetDlgItem(IDC_EDIT_VALUE));
74 |
75 | if (!m_pSlider || !m_pSliderValue)
76 | {
77 | return false;
78 | }
79 |
80 | m_pSlider->SetRange(0, 360, false);
81 |
82 | return true;
83 | }
84 |
85 |
86 | void DOPPRotationDlg::OnBnClickedOk()
87 | {
88 | CDialogEx::OnOK();
89 | }
90 |
91 |
92 | void DOPPRotationDlg::OnBnClickedCancle()
93 | {
94 | CDialogEx::OnCancel();
95 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/DOPPRotationDlg.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | class DOPPRotationDlg : public CDialogEx
26 | {
27 | DECLARE_DYNAMIC(DOPPRotationDlg)
28 |
29 | public:
30 | DOPPRotationDlg(CWnd* pParent = nullptr);
31 | virtual ~DOPPRotationDlg();
32 |
33 | enum { IDD = IDD_DIALOG_ANGLE };
34 |
35 | unsigned int getAngle() { return m_uiAngle; };
36 |
37 | protected:
38 |
39 | virtual BOOL OnInitDialog();
40 |
41 | virtual void DoDataExchange(CDataExchange* pDX);
42 |
43 | DECLARE_MESSAGE_MAP()
44 |
45 | private:
46 |
47 | CSliderCtrl* m_pSlider;
48 | CEdit* m_pSliderValue;
49 |
50 | unsigned int m_uiAngle;
51 |
52 | public:
53 | afx_msg void OnNMCustomdrawSliderAngle(NMHDR *pNMHDR, LRESULT *pResult);
54 | afx_msg void OnBnClickedOk();
55 | afx_msg void OnBnClickedCancle();
56 | };
57 |
--------------------------------------------------------------------------------
/DOPPEngine/src/DisplayManager.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include
24 | #include
25 |
26 | #include "ADL/adl_sdk.h"
27 | #include
28 |
29 | #include "DisplayManager.h"
30 |
31 | typedef int(*ADL_MAIN_CONTROL_CREATE) (ADL_MAIN_MALLOC_CALLBACK, int);
32 | typedef int(*ADL_MAIN_CONTROL_DESTROY) ();
33 | typedef int(*ADL_ADAPTER_NUMBEROFADAPTERS_GET) (int*);
34 | typedef int(*ADL_ADAPTER_ACTIVE_GET) (int, int*);
35 | typedef int(*ADL_ADAPTER_ADAPTERINFO_GET) (LPAdapterInfo, int);
36 | typedef int(*ADL_ADAPTER_ACTIVE_GET) (int, int*);
37 | typedef int(*ADL_DISPLAY_DISPLAYINFO_GET) (int, int*, ADLDisplayInfo**, int);
38 | typedef int(*ADL_DISPLAY_PROPERTY_GET) (int, int, ADLDisplayProperty*);
39 | typedef int(*ADL_DISPLAY_MODES_GET) (int, int, int*, ADLMode**);
40 | typedef int(*ADL_DISPLAY_POSITION_GET) (int, int, int*, int*, int*, int*, int*, int*, int*, int*, int*, int*);
41 | typedef int(*ADL_DISPLAY_SIZE_GET) (int, int, int*, int*, int*, int*, int*, int*, int*, int*, int*, int*);
42 |
43 |
44 | typedef struct
45 | {
46 | HMODULE hDLL;
47 | ADL_MAIN_CONTROL_CREATE ADL_Main_Control_Create;
48 | ADL_MAIN_CONTROL_DESTROY ADL_Main_Control_Destroy;
49 | ADL_ADAPTER_NUMBEROFADAPTERS_GET ADL_Adapter_NumberOfAdapters_Get;
50 | ADL_ADAPTER_ACTIVE_GET ADL_Adapter_Active_Get;
51 | ADL_ADAPTER_ADAPTERINFO_GET ADL_Adapter_AdapterInfo_Get;
52 | ADL_DISPLAY_DISPLAYINFO_GET ADL_Display_DisplayInfo_Get;
53 | ADL_DISPLAY_PROPERTY_GET ADL_Display_Property_Get;
54 | ADL_DISPLAY_MODES_GET ADL_Display_Modes_Get;
55 | ADL_DISPLAY_POSITION_GET ADL_Display_Position_Get;
56 | ADL_DISPLAY_SIZE_GET ADL_Display_Size_Get;
57 | } ADLFunctions;
58 |
59 |
60 | static ADLFunctions g_AdlCalls = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
61 |
62 |
63 | typedef struct DisplayData
64 | {
65 | unsigned int uiGPUId;
66 | unsigned int uiDisplayId;
67 | unsigned int uiDisplayLogicalId;
68 | int nOriginX;
69 | int nOriginY;
70 | unsigned int uiWidth;
71 | unsigned int uiHeight;
72 | std::string strDisplayname;
73 | } DISPLAY_DATA;
74 |
75 |
76 | // Memory Allocation function needed for ADL
77 | void* __stdcall ADL_Alloc(int iSize)
78 | {
79 | void* lpBuffer = malloc(iSize);
80 | return lpBuffer;
81 | }
82 |
83 |
84 | // Memory Free function needed for ADL
85 | void __stdcall ADL_Free(void* lpBuffer)
86 | {
87 | if (nullptr != lpBuffer)
88 | {
89 | free(lpBuffer);
90 | lpBuffer = nullptr;
91 | }
92 | }
93 |
94 |
95 | using namespace std;
96 |
97 |
98 | DisplayManager::DisplayManager()
99 | : m_uiNumGPU(0)
100 | {
101 | m_Displays.clear();
102 | }
103 |
104 |
105 | DisplayManager::~DisplayManager()
106 | {
107 | deleteDisplays();
108 | }
109 |
110 |
111 | unsigned int DisplayManager::enumDisplays()
112 | {
113 | int nNumDisplays = 0;
114 | int nNumAdapters = 0;
115 | int nCurrentBusNumber = 0;
116 | LPAdapterInfo pAdapterInfo = nullptr;
117 | unsigned int uiCurrentGPUId = 0;
118 | unsigned int uiCurrentDisplayId = 0;
119 |
120 | // load all required ADL functions
121 | if (!setupADL())
122 | {
123 | return 0;
124 | }
125 |
126 | if (m_Displays.size() > 0)
127 | {
128 | deleteDisplays();
129 | }
130 |
131 | // Determine how many adapters and displays are in the system
132 | g_AdlCalls.ADL_Adapter_NumberOfAdapters_Get(&nNumAdapters);
133 |
134 | if (nNumAdapters > 0)
135 | {
136 | pAdapterInfo = static_cast(ADL_Alloc(sizeof(AdapterInfo) * nNumAdapters));
137 | memset(pAdapterInfo, '\0', sizeof(AdapterInfo) * nNumAdapters);
138 | }
139 |
140 | g_AdlCalls.ADL_Adapter_AdapterInfo_Get(pAdapterInfo, sizeof(AdapterInfo) * nNumAdapters);
141 |
142 | // Loop through all adapters
143 | for (int i = 0; i < nNumAdapters; ++i)
144 | {
145 | int nAdapterIdx;
146 | int nAdapterStatus;
147 |
148 | nAdapterIdx = pAdapterInfo[i].iAdapterIndex;
149 |
150 | g_AdlCalls.ADL_Adapter_Active_Get(nAdapterIdx, &nAdapterStatus);
151 |
152 | if (nAdapterStatus)
153 | {
154 | LPADLDisplayInfo pDisplayInfo = nullptr;
155 |
156 | g_AdlCalls.ADL_Display_DisplayInfo_Get(nAdapterIdx, &nNumDisplays, &pDisplayInfo, 0);
157 |
158 | for (int j = 0; j < nNumDisplays; ++j)
159 | {
160 | // check if display is connected and mapped
161 | if (pDisplayInfo[j].iDisplayInfoValue & ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED)
162 | {
163 | // check if display is mapped on adapter
164 | if ((pDisplayInfo[j].iDisplayInfoValue & ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED) && (pDisplayInfo[j].displayID.iDisplayLogicalAdapterIndex == nAdapterIdx))
165 | {
166 | if (nCurrentBusNumber == 0)
167 | {
168 | // Found first GPU in the system
169 | ++m_uiNumGPU;
170 | nCurrentBusNumber = pAdapterInfo[nAdapterIdx].iBusNumber;
171 | }
172 | else if (nCurrentBusNumber != pAdapterInfo[nAdapterIdx].iBusNumber)
173 | {
174 | // found new GPU
175 | ++m_uiNumGPU;
176 | ++uiCurrentGPUId;
177 | nCurrentBusNumber = pAdapterInfo[nAdapterIdx].iBusNumber;
178 | }
179 |
180 | // Found first mapped display
181 | DisplayData* pDsp = new DisplayData;
182 |
183 | pDsp->uiGPUId = uiCurrentGPUId;
184 | pDsp->uiDisplayId = uiCurrentDisplayId;
185 | pDsp->uiDisplayLogicalId = pDisplayInfo[j].displayID.iDisplayLogicalIndex;
186 | pDsp->strDisplayname = string(pAdapterInfo[i].strDisplayName);
187 | pDsp->nOriginX = 0;
188 | pDsp->nOriginY = 0;
189 | pDsp->uiWidth = 0;
190 | pDsp->uiHeight = 0;
191 |
192 | DEVMODEA DevMode;
193 | memset(&DevMode, 0, sizeof(DEVMODEA));
194 |
195 | EnumDisplaySettingsA(pDsp->strDisplayname.c_str(), ENUM_CURRENT_SETTINGS, &DevMode);
196 |
197 | pDsp->nOriginX = DevMode.dmPosition.x;
198 | pDsp->nOriginY = DevMode.dmPosition.y;
199 | pDsp->uiWidth = DevMode.dmPelsWidth;
200 | pDsp->uiHeight = DevMode.dmPelsHeight;
201 |
202 | m_Displays.push_back(pDsp);
203 |
204 | ++uiCurrentDisplayId;
205 | }
206 | }
207 | }
208 |
209 | ADL_Free(pDisplayInfo);
210 | }
211 | }
212 |
213 | if (pAdapterInfo)
214 | {
215 | ADL_Free(pAdapterInfo);
216 | }
217 |
218 | return static_cast(m_Displays.size());
219 | }
220 |
221 |
222 | void DisplayManager::deleteDisplays()
223 | {
224 | for (const auto& pDisplay : m_Displays)
225 | {
226 | if (pDisplay)
227 | {
228 | delete pDisplay;
229 | }
230 | }
231 |
232 | m_Displays.clear();
233 |
234 | m_uiNumGPU = 0;
235 | }
236 |
237 |
238 | unsigned int DisplayManager::getNumGPUs()
239 | {
240 | if (m_Displays.size() > 0)
241 | {
242 | return m_uiNumGPU;
243 | }
244 |
245 | return 0;
246 | }
247 |
248 |
249 | unsigned int DisplayManager::getNumDisplays()
250 | {
251 | return static_cast(m_Displays.size());
252 | }
253 |
254 |
255 | unsigned int DisplayManager::getNumDisplaysOnGPU(unsigned int uiGPU)
256 | {
257 | unsigned int uiNumDsp = 0;
258 |
259 | for (const auto& pDisplay : m_Displays)
260 | {
261 | if (pDisplay->uiGPUId == uiGPU)
262 | {
263 | ++uiNumDsp;
264 | }
265 | }
266 |
267 | return uiNumDsp;
268 | }
269 |
270 |
271 | unsigned int DisplayManager::getDisplayOnGPU(unsigned int uiGPU, unsigned int n)
272 | {
273 | unsigned int uiCurrentDisplayOnGpu = 0;
274 |
275 | for (const auto& pDisplay : m_Displays)
276 | {
277 | if (pDisplay->uiGPUId == uiGPU)
278 | {
279 | if (uiCurrentDisplayOnGpu == n)
280 | {
281 | return pDisplay->uiDisplayId;
282 | }
283 |
284 | ++uiCurrentDisplayOnGpu;
285 | }
286 | }
287 |
288 | return 0;
289 | }
290 |
291 | const char* DisplayManager::getDisplayName(unsigned int uiDisplay)
292 | {
293 | if (uiDisplay < m_Displays.size())
294 | {
295 | return m_Displays[uiDisplay]->strDisplayname.c_str();
296 | }
297 |
298 | return nullptr;
299 | }
300 |
301 |
302 | unsigned int DisplayManager::getGpuId(unsigned int uiDisplay)
303 | {
304 | if (uiDisplay < m_Displays.size())
305 | {
306 | return m_Displays[uiDisplay]->uiGPUId;
307 | }
308 |
309 | return 0;
310 | }
311 |
312 |
313 | bool DisplayManager::getOrigin(unsigned int uiDisplay, int& nOriginX, int& nOriginY)
314 | {
315 | nOriginX = 0;
316 | nOriginY = 0;
317 |
318 | if (uiDisplay < m_Displays.size())
319 | {
320 | nOriginX = m_Displays[uiDisplay]->nOriginX;
321 | nOriginY = m_Displays[uiDisplay]->nOriginY;
322 |
323 | return true;
324 | }
325 |
326 | return false;
327 | }
328 |
329 |
330 | bool DisplayManager::getSize(unsigned int uiDisplay, unsigned int& uiWidth, unsigned int& uiHeight)
331 | {
332 | uiWidth = 0;
333 | uiHeight = 0;
334 |
335 | if (uiDisplay < m_Displays.size())
336 | {
337 | uiWidth = m_Displays[uiDisplay]->uiWidth;
338 | uiHeight = m_Displays[uiDisplay]->uiHeight;
339 |
340 | return true;
341 | }
342 |
343 | return false;
344 | }
345 |
346 |
347 | bool DisplayManager::setupADL()
348 | {
349 | // check if ADL was already loaded
350 | if (g_AdlCalls.hDLL)
351 | {
352 | return true;
353 | }
354 |
355 | g_AdlCalls.hDLL = LoadLibrary(L"atiadlxx.dll");
356 |
357 | if (g_AdlCalls.hDLL == nullptr)
358 | {
359 | g_AdlCalls.hDLL = LoadLibrary(L"atiadlxy.dll");
360 | }
361 |
362 | if (!g_AdlCalls.hDLL)
363 | {
364 | return false;
365 | }
366 |
367 | // Get proc address of needed ADL functions
368 | g_AdlCalls.ADL_Main_Control_Create = (ADL_MAIN_CONTROL_CREATE)GetProcAddress(g_AdlCalls.hDLL, "ADL_Main_Control_Create");
369 | if (!g_AdlCalls.ADL_Main_Control_Create)
370 | {
371 | return false;
372 | }
373 |
374 | g_AdlCalls.ADL_Main_Control_Destroy = (ADL_MAIN_CONTROL_DESTROY)GetProcAddress(g_AdlCalls.hDLL, "ADL_Main_Control_Destroy");
375 | if (!g_AdlCalls.ADL_Main_Control_Destroy)
376 | {
377 | return false;
378 | }
379 |
380 | g_AdlCalls.ADL_Adapter_NumberOfAdapters_Get = (ADL_ADAPTER_NUMBEROFADAPTERS_GET)GetProcAddress(g_AdlCalls.hDLL, "ADL_Adapter_NumberOfAdapters_Get");
381 | if (!g_AdlCalls.ADL_Adapter_NumberOfAdapters_Get)
382 | {
383 | return false;
384 | }
385 |
386 | g_AdlCalls.ADL_Adapter_AdapterInfo_Get = (ADL_ADAPTER_ADAPTERINFO_GET)GetProcAddress(g_AdlCalls.hDLL, "ADL_Adapter_AdapterInfo_Get");
387 | if (!g_AdlCalls.ADL_Adapter_AdapterInfo_Get)
388 | {
389 | return false;
390 | }
391 |
392 | g_AdlCalls.ADL_Display_DisplayInfo_Get = (ADL_DISPLAY_DISPLAYINFO_GET)GetProcAddress(g_AdlCalls.hDLL, "ADL_Display_DisplayInfo_Get");
393 | if (!g_AdlCalls.ADL_Display_DisplayInfo_Get)
394 | {
395 | return false;
396 | }
397 |
398 | g_AdlCalls.ADL_Adapter_Active_Get = (ADL_ADAPTER_ACTIVE_GET)GetProcAddress(g_AdlCalls.hDLL, "ADL_Adapter_Active_Get");
399 | if (!g_AdlCalls.ADL_Adapter_Active_Get)
400 | {
401 | return false;
402 | }
403 |
404 | g_AdlCalls.ADL_Display_Position_Get = (ADL_DISPLAY_POSITION_GET)GetProcAddress(g_AdlCalls.hDLL, "ADL_Display_Position_Get");
405 | if (!g_AdlCalls.ADL_Display_Position_Get)
406 | {
407 | return false;
408 | }
409 |
410 | g_AdlCalls.ADL_Display_Size_Get = (ADL_DISPLAY_POSITION_GET)GetProcAddress(g_AdlCalls.hDLL, "ADL_Display_Size_Get");
411 | if (!g_AdlCalls.ADL_Display_Size_Get)
412 | {
413 | return false;
414 | }
415 |
416 | g_AdlCalls.ADL_Display_Modes_Get = (ADL_DISPLAY_MODES_GET)GetProcAddress(g_AdlCalls.hDLL, "ADL_Display_Modes_Get");
417 | if (!g_AdlCalls.ADL_Display_Modes_Get)
418 | {
419 | return false;
420 | }
421 |
422 | g_AdlCalls.ADL_Display_Property_Get = (ADL_DISPLAY_PROPERTY_GET)GetProcAddress(g_AdlCalls.hDLL, "ADL_Display_Property_Get");
423 | if (!g_AdlCalls.ADL_Display_Property_Get)
424 | {
425 | return false;
426 | }
427 |
428 | // Init ADL
429 | if (g_AdlCalls.ADL_Main_Control_Create(ADL_Alloc, 0) != ADL_OK)
430 | {
431 | return false;
432 | }
433 |
434 | return true;
435 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/DisplayManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | #include
26 |
27 | struct DisplayData;
28 |
29 | class DisplayManager
30 | {
31 | public:
32 |
33 | DisplayManager();
34 | ~DisplayManager();
35 |
36 | // Enumerates the active desktops. This functions needs to be called before any other method of this class
37 | // returns the number of active desktops
38 | unsigned int enumDisplays();
39 |
40 | // returns the number of GPUs in the system
41 | unsigned int getNumGPUs();
42 |
43 | unsigned int getNumDisplays();
44 |
45 | // returns the number of displays mapped on GPU uiGPU
46 | unsigned int getNumDisplaysOnGPU(unsigned int uiGPU);
47 |
48 | // returns the DisplayID of n-th Display on GPU uiGPU
49 | // n=0 will return the first display on GPU uiGPU if available
50 | // n=1 will return the second display on GPU uiGPU if available ...
51 | unsigned int getDisplayOnGPU(unsigned int uiGPU, unsigned int n = 0);
52 |
53 | const char* getDisplayName(unsigned int uiDisplay);
54 |
55 | unsigned int getGpuId(unsigned int uiDisplay);
56 |
57 | bool getOrigin(unsigned int uiDisplay, int& uiOriginX, int& uiOriginY);
58 |
59 | bool getSize(unsigned int uiDisplay, unsigned int& uiWidth, unsigned int& uiHeight);
60 |
61 | private:
62 |
63 | bool setupADL();
64 | void deleteDisplays();
65 |
66 | unsigned int m_uiNumGPU;
67 |
68 | std::vector m_Displays;
69 | };
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPColorInvert.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "StdAfx.h"
24 | #include
25 |
26 | #include "GLDOPPColorInvert.h"
27 | #include "GLShader.h"
28 |
29 |
30 | GLDOPPColorInvert::GLDOPPColorInvert()
31 | : GLDOPPEngine()
32 | , m_pProgram(nullptr)
33 | , m_uiBasmapLoc(0)
34 | {}
35 |
36 |
37 | GLDOPPColorInvert::~GLDOPPColorInvert()
38 | {
39 | if (m_pProgram)
40 | {
41 | delete m_pProgram;
42 | }
43 | }
44 |
45 |
46 | bool GLDOPPColorInvert::initEffect()
47 | {
48 | if (m_pProgram)
49 | {
50 | delete m_pProgram;
51 | }
52 |
53 | m_pProgram = new GLShader;
54 |
55 | if ((!m_pProgram->createVertexShaderFromFile("Shaders/base.vp")) || (!m_pProgram->createFragmentShaderFromFile("Shaders/colorInv.fp")))
56 | {
57 | return false;
58 | }
59 |
60 | if (!m_pProgram->buildProgram())
61 | {
62 | return false;
63 | }
64 |
65 | m_uiBasmapLoc = glGetUniformLocation(m_pProgram->getProgram(), "baseMap");
66 |
67 | return true;
68 | }
69 |
70 |
71 | void GLDOPPColorInvert::updateTexture()
72 | {
73 | glDisable(GL_DEPTH_TEST);
74 |
75 | m_pProgram->bind();
76 |
77 | glActiveTexture(GL_TEXTURE1);
78 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture);
79 |
80 | glUniform1i(m_uiBasmapLoc, 1);
81 |
82 | glBindVertexArray(m_uiVertexArray);
83 | glDrawArrays(GL_TRIANGLES, 0, 3);
84 | glBindVertexArray(0);
85 |
86 | glEnable(GL_DEPTH_TEST);
87 |
88 | m_pProgram->unbind();
89 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPColorInvert.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | #include "GLDOPPEngine.h"
26 |
27 | class GLDOPPColorInvert : public GLDOPPEngine
28 | {
29 | public:
30 | GLDOPPColorInvert();
31 | ~GLDOPPColorInvert();
32 |
33 | bool initEffect();
34 | void updateTexture();
35 |
36 | private:
37 |
38 | GLShader* m_pProgram;
39 | GLuint m_uiBasmapLoc;
40 | };
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPDistort.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "StdAfx.h"
24 | #include
25 |
26 | #include "GLShader.h"
27 | #include "GLDOPPDistort.h"
28 |
29 |
30 | GLDOPPDistort::GLDOPPDistort()
31 | : m_pProgram(nullptr)
32 | , m_uiBasmapLoc(0)
33 | , m_uiTimerLoc(0)
34 | {
35 | m_lStartCount.QuadPart = 0;
36 | QueryPerformanceFrequency(&m_lFreq);
37 | }
38 |
39 |
40 | GLDOPPDistort::~GLDOPPDistort()
41 | {
42 | if (m_pProgram)
43 | {
44 | delete m_pProgram;
45 | }
46 | }
47 |
48 |
49 | bool GLDOPPDistort::initEffect()
50 | {
51 | if (m_pProgram)
52 | {
53 | delete m_pProgram;
54 | }
55 |
56 | m_pProgram = new GLShader;
57 |
58 | if ((!m_pProgram->createVertexShaderFromFile("Shaders/base.vp")) || (!m_pProgram->createFragmentShaderFromFile("Shaders/distort.fp")))
59 | {
60 | return false;
61 | }
62 |
63 | if (!m_pProgram->buildProgram())
64 | {
65 | return false;
66 | }
67 |
68 | m_uiBasmapLoc = glGetUniformLocation(m_pProgram->getProgram(), "baseMap");
69 | m_uiTimerLoc = glGetUniformLocation(m_pProgram->getProgram(), "fTime");
70 |
71 | QueryPerformanceCounter((LARGE_INTEGER*)&m_lStartCount);
72 |
73 | return true;
74 | }
75 |
76 |
77 | void GLDOPPDistort::updateTexture()
78 | {
79 | LARGE_INTEGER lCounter;
80 | float fElapsed;
81 |
82 | QueryPerformanceCounter(&lCounter);
83 |
84 | long long lDelta = lCounter.QuadPart - m_lStartCount.QuadPart;
85 |
86 | fElapsed = (static_cast(lDelta) / m_lFreq.QuadPart);
87 |
88 | glDisable(GL_DEPTH_TEST);
89 |
90 | m_pProgram->bind();
91 |
92 | glActiveTexture(GL_TEXTURE1);
93 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture);
94 |
95 | glUniform1i(m_uiBasmapLoc, 1);
96 | glUniform1f(m_uiTimerLoc, fElapsed);
97 |
98 | glBindVertexArray(m_uiVertexArray);
99 | glDrawArrays(GL_TRIANGLES, 0, 3);
100 | glBindVertexArray(0);
101 |
102 | glEnable(GL_DEPTH_TEST);
103 |
104 | m_pProgram->unbind();
105 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPDistort.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | #include "GLDOPPEngine.h"
26 |
27 | class GLDOPPDistort : public GLDOPPEngine
28 | {
29 | public:
30 | GLDOPPDistort();
31 | ~GLDOPPDistort();
32 |
33 | bool initEffect();
34 | void updateTexture();
35 |
36 | private:
37 |
38 | GLShader* m_pProgram;
39 | GLuint m_uiBasmapLoc;
40 | GLuint m_uiTimerLoc;
41 |
42 | LARGE_INTEGER m_lStartCount;
43 | LARGE_INTEGER m_lFreq;
44 | };
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPEdgeFilter.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "StdAfx.h"
24 | #include
25 |
26 | #include "GLDOPPEdgeFilter.h"
27 | #include "GLShader.h"
28 |
29 |
30 | GLDOPPEdgeFilter::GLDOPPEdgeFilter()
31 | : m_pProgram(nullptr)
32 | , m_uiBasmapLoc(0)
33 | {}
34 |
35 |
36 | GLDOPPEdgeFilter::~GLDOPPEdgeFilter()
37 | {
38 | if (m_pProgram)
39 | {
40 | delete m_pProgram;
41 | }
42 | }
43 |
44 |
45 | bool GLDOPPEdgeFilter::initEffect()
46 | {
47 | if (m_pProgram)
48 | {
49 | delete m_pProgram;
50 | }
51 |
52 | m_pProgram = new GLShader;
53 |
54 | if ((!m_pProgram->createVertexShaderFromFile("Shaders/base.vp")) || (!m_pProgram->createFragmentShaderFromFile("Shaders/laplace.fp")))
55 | {
56 | return false;
57 | }
58 |
59 | if (!m_pProgram->buildProgram())
60 | {
61 | return false;
62 | }
63 |
64 | m_uiBasmapLoc = glGetUniformLocation(m_pProgram->getProgram(), "baseMap");
65 |
66 | return true;
67 | }
68 |
69 |
70 | void GLDOPPEdgeFilter::updateTexture()
71 | {
72 | glDisable(GL_DEPTH_TEST);
73 |
74 | m_pProgram->bind();
75 |
76 | glActiveTexture(GL_TEXTURE1);
77 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture);
78 |
79 | glUniform1i(m_uiBasmapLoc, 1);
80 |
81 | glBindVertexArray(m_uiVertexArray);
82 | glDrawArrays(GL_TRIANGLES, 0, 3);
83 | glBindVertexArray(0);
84 |
85 | glEnable(GL_DEPTH_TEST);
86 |
87 | m_pProgram->unbind();
88 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPEdgeFilter.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | #include "GLDOPPEngine.h"
26 |
27 | class GLShader;
28 |
29 | class GLDOPPEdgeFilter : public GLDOPPEngine
30 | {
31 | public:
32 | GLDOPPEdgeFilter();
33 | ~GLDOPPEdgeFilter();
34 |
35 | bool initEffect();
36 | void updateTexture();
37 |
38 | private:
39 |
40 | GLShader* m_pProgram;
41 | GLuint m_uiBasmapLoc;
42 | };
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPEngine.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "stdafx.h"
24 |
25 | #include
26 | #include
27 |
28 | #include "GLDOPPEngine.h"
29 | #include "GLShader.h"
30 |
31 | #define GL_WAIT_FOR_PREVIOUS_VSYNC 0x931C
32 |
33 | typedef GLuint(APIENTRY* PFNWGLGETDESKTOPTEXTUREAMD)(void);
34 | typedef void(APIENTRY* PFNWGLENABLEPOSTPROCESSAMD)(bool enable);
35 | typedef GLuint(APIENTRY* WGLGENPRESENTTEXTUREAMD)(void);
36 | typedef GLboolean(APIENTRY* WGLDESKTOPTARGETAMD)(GLuint);
37 | typedef GLuint(APIENTRY* PFNWGLPRESENTTEXTURETOVIDEOAMD)(GLuint presentTexture, const GLuint* attrib_list);
38 |
39 | PFNWGLGETDESKTOPTEXTUREAMD wglGetDesktopTextureAMD;
40 | PFNWGLENABLEPOSTPROCESSAMD wglEnablePostProcessAMD;
41 | PFNWGLPRESENTTEXTURETOVIDEOAMD wglPresentTextureToVideoAMD;
42 | WGLDESKTOPTARGETAMD wglDesktopTargetAMD;
43 | WGLGENPRESENTTEXTUREAMD wglGenPresentTextureAMD;
44 |
45 | #define GET_PROC(xx) \
46 | { \
47 | void **x = reinterpret_cast(&xx); \
48 | *x = static_cast(wglGetProcAddress(#xx)); \
49 | if (*x == nullptr) { \
50 | return false; \
51 | } \
52 | }
53 |
54 |
55 | GLDOPPEngine::GLDOPPEngine()
56 | : m_uiDesktopWidth(0)
57 | , m_uiDesktopHeight(0)
58 | , m_uiDesktopTexture(0)
59 | , m_uiPresentTexture(0)
60 | , m_uiFBO(0)
61 | , m_uiBaseMap(0)
62 | , m_pShader(nullptr)
63 | , m_uiVertexBuffer(0)
64 | , m_uiVertexArray(0)
65 | , m_bStartPostProcessing(false)
66 | , m_bDoPresent(false)
67 | {}
68 |
69 |
70 | GLDOPPEngine::~GLDOPPEngine()
71 | {
72 | if (m_bDoPresent)
73 | {
74 | wglEnablePostProcessAMD(false);
75 | }
76 |
77 | glFinish();
78 |
79 | if (m_pShader)
80 | {
81 | delete m_pShader;
82 | m_pShader = nullptr;
83 | }
84 |
85 | if (m_uiDesktopTexture)
86 | {
87 | glDeleteTextures(1, &m_uiDesktopTexture);
88 | }
89 |
90 | if (m_uiFBO)
91 | {
92 | glDeleteFramebuffers(1, &m_uiFBO);
93 | }
94 |
95 | if (m_uiVertexBuffer)
96 | {
97 | glDeleteBuffers(1, &m_uiVertexBuffer);
98 | }
99 |
100 | if (m_uiVertexArray)
101 | {
102 | glDeleteVertexArrays(1, &m_uiVertexArray);
103 | }
104 | }
105 |
106 |
107 | bool GLDOPPEngine::initDOPP(unsigned int uiDesktop, bool bPresent)
108 | {
109 | if (!setupDOPPExtension())
110 | {
111 | return false;
112 | }
113 |
114 | // Select Desktop to be processed. ID is the same as seen in CCC
115 | if (!wglDesktopTargetAMD(uiDesktop))
116 | {
117 | return false;
118 | }
119 |
120 | glActiveTexture(GL_TEXTURE1);
121 |
122 | // Get Desktop Texture. Instead of creating a regular texture we request the desktop texture
123 | m_uiDesktopTexture = wglGetDesktopTextureAMD();
124 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture);
125 |
126 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
127 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
128 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
129 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
130 |
131 | // Get size of the desktop. Usually this is the same values as returned by GetSystemMetrics(SM_CXSCREEN)
132 | // and GetSystemMetrics(SM_CYSCREEN). In some cases it might differ, e.g. if a rotated desktop is used.
133 | glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, reinterpret_cast(&m_uiDesktopWidth));
134 | glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, reinterpret_cast(&m_uiDesktopHeight));
135 |
136 | glBindTexture(GL_TEXTURE_2D, 0);
137 |
138 | // Create FBO that is used to generate the present texture. We will render into this FBO
139 | // in order to create the present texture
140 | glGenFramebuffers(1, &m_uiFBO);
141 |
142 | // generate present texture
143 | m_uiPresentTexture = wglGenPresentTextureAMD();
144 |
145 | glBindTexture(GL_TEXTURE_2D, m_uiPresentTexture);
146 |
147 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
148 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
149 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
150 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
151 |
152 | glBindTexture(GL_TEXTURE_2D, 0);
153 |
154 | glBindFramebuffer(GL_FRAMEBUFFER, m_uiFBO);
155 |
156 | glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_uiPresentTexture, 0);
157 |
158 | GLenum FBStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER);
159 |
160 | glBindFramebuffer(GL_FRAMEBUFFER, 0);
161 |
162 | if (FBStatus != GL_FRAMEBUFFER_COMPLETE)
163 | {
164 | return false;
165 | }
166 |
167 | m_bStartPostProcessing = bPresent;
168 | m_bDoPresent = bPresent;
169 |
170 | glGenVertexArrays(1, &m_uiVertexArray);
171 |
172 | return true;
173 | }
174 |
175 |
176 | bool GLDOPPEngine::initEffect()
177 | {
178 | if (m_pShader)
179 | {
180 | delete m_pShader;
181 | }
182 |
183 | m_pShader = new GLShader;
184 |
185 | // Load basic shader
186 | if (!m_pShader->createVertexShaderFromFile("base.vp"))
187 | {
188 | return false;
189 | }
190 |
191 | if (!m_pShader->createFragmentShaderFromFile("base.fp"))
192 | {
193 | return false;
194 | }
195 |
196 | if (!m_pShader->buildProgram())
197 | {
198 | return false;
199 | }
200 |
201 | m_pShader->bind();
202 |
203 | m_uiBaseMap = glGetUniformLocation(m_pShader->getProgram(), "baseMap");
204 |
205 | return true;
206 | }
207 |
208 |
209 | bool GLDOPPEngine::setDesktop(unsigned int uIDesktop)
210 | {
211 | if (wglDesktopTargetAMD(uIDesktop))
212 | {
213 | return true;
214 | }
215 |
216 | return false;
217 | }
218 |
219 |
220 | void GLDOPPEngine::processDesktop(bool bBlocking)
221 | {
222 | int pVP[4];
223 |
224 | glGetIntegerv(GL_VIEWPORT, pVP);
225 |
226 | // Bind FBO that has the present texture attached
227 | glBindFramebuffer(GL_FRAMEBUFFER, m_uiFBO);
228 |
229 | // Set viewport for this FBO
230 | glViewport(0, 0, m_uiDesktopWidth, m_uiDesktopHeight);
231 |
232 | // Render to FBO
233 | updateTexture();
234 |
235 | glBindFramebuffer(GL_FRAMEBUFFER, 0);
236 | glBindTexture(GL_TEXTURE_2D, 0);
237 |
238 | if (m_bDoPresent)
239 | {
240 | const GLuint attrib[] = { (bBlocking ? GL_WAIT_FOR_PREVIOUS_VSYNC : 0), 0 };
241 |
242 | // Set the new desktop texture
243 | wglPresentTextureToVideoAMD(m_uiPresentTexture, attrib);
244 |
245 | if (m_bStartPostProcessing)
246 | {
247 | m_bStartPostProcessing = false;
248 |
249 | wglEnablePostProcessAMD(true);
250 | }
251 |
252 | glFinish();
253 | }
254 |
255 | glBindFramebuffer(GL_FRAMEBUFFER, 0);
256 |
257 | // restore original viewport
258 | glViewport(pVP[0], pVP[1], pVP[2], pVP[3]);
259 | }
260 |
261 |
262 | void GLDOPPEngine::updateTexture()
263 | {
264 | m_pShader->bind();
265 |
266 | glActiveTexture(GL_TEXTURE1);
267 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture);
268 |
269 | glUniform1i(m_uiBaseMap, 1);
270 |
271 | glBindVertexArray(m_uiVertexArray);
272 | glDrawArrays(GL_TRIANGLES, 0, 3);
273 | glBindVertexArray(0);
274 |
275 | m_pShader->unbind();
276 | }
277 |
278 |
279 | bool GLDOPPEngine::setupDOPPExtension()
280 | {
281 | GET_PROC(wglGetDesktopTextureAMD);
282 | GET_PROC(wglEnablePostProcessAMD);
283 | GET_PROC(wglPresentTextureToVideoAMD);
284 | GET_PROC(wglDesktopTargetAMD);
285 | GET_PROC(wglGenPresentTextureAMD);
286 |
287 | return true;
288 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPEngine.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | #include
26 |
27 | class GLShader;
28 |
29 | class GLDOPPEngine
30 | {
31 | public:
32 |
33 | GLDOPPEngine();
34 | virtual ~GLDOPPEngine();
35 |
36 | bool initDOPP(unsigned int uiDesktop = 1, bool bPresent = true);
37 |
38 | bool setDesktop(unsigned int uiDesktop);
39 |
40 | virtual bool initEffect();
41 | virtual void updateTexture();
42 |
43 | void processDesktop(bool bBlocking = false);
44 |
45 | GLuint getPresentTexture() { return m_uiPresentTexture; };
46 | GLuint getPresentBuffer() { return m_uiFBO; };
47 | GLuint getDesktopTexture() { return m_uiDesktopTexture; };
48 |
49 | unsigned int getDesktopWidth() { return m_uiDesktopWidth; };
50 | unsigned int getDesktopHeight() { return m_uiDesktopHeight; };
51 |
52 | protected:
53 |
54 | GLuint m_uiDesktopTexture;
55 | GLuint m_uiPresentTexture;
56 |
57 | GLuint m_uiVertexBuffer;
58 | GLuint m_uiVertexArray;
59 |
60 | GLShader* m_pShader;
61 | GLuint m_uiBaseMap;
62 |
63 | unsigned int m_uiDesktopWidth;
64 | unsigned int m_uiDesktopHeight;
65 |
66 | private:
67 |
68 | bool setupDOPPExtension();
69 |
70 | GLuint m_uiFBO;
71 |
72 | bool m_bStartPostProcessing;
73 | bool m_bDoPresent;
74 | };
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPEyefinityLandscape.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "StdAfx.h"
24 | #include
25 |
26 | #include "GLDOPPEyefinityLandscape.h"
27 | #include "GLShader.h"
28 |
29 |
30 | GLDOPPEyefinityLandscape::GLDOPPEyefinityLandscape()
31 | : GLDOPPEngine()
32 | , m_pProgram(nullptr)
33 | , m_uiBasmapLoc(0)
34 | {}
35 |
36 | GLDOPPEyefinityLandscape::~GLDOPPEyefinityLandscape()
37 | {
38 | if (m_pProgram)
39 | {
40 | delete m_pProgram;
41 | }
42 | }
43 |
44 |
45 | bool GLDOPPEyefinityLandscape::initEffect()
46 | {
47 | if (m_pProgram)
48 | {
49 | delete m_pProgram;
50 | }
51 |
52 | m_pProgram = new GLShader;
53 |
54 | if ((!m_pProgram->createVertexShaderFromFile("Shaders/base.vp")) || (!m_pProgram->createFragmentShaderFromFile("Shaders/landscape.fp")))
55 | {
56 | return false;
57 | }
58 |
59 | if (!m_pProgram->buildProgram())
60 | {
61 | return false;
62 | }
63 |
64 | m_uiBasmapLoc = glGetUniformLocation(m_pProgram->getProgram(), "baseMap");
65 |
66 | return true;
67 | }
68 |
69 |
70 | void GLDOPPEyefinityLandscape::updateTexture()
71 | {
72 | glDisable(GL_DEPTH_TEST);
73 |
74 | m_pProgram->bind();
75 |
76 | glActiveTexture(GL_TEXTURE1);
77 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture);
78 |
79 | glUniform1i(m_uiBasmapLoc, 1);
80 |
81 | glBindVertexArray(m_uiVertexArray);
82 | glDrawArrays(GL_TRIANGLES, 0, 3);
83 | glBindVertexArray(0);
84 |
85 | glEnable(GL_DEPTH_TEST);
86 |
87 | m_pProgram->unbind();
88 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPEyefinityLandscape.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | #include "GLDOPPEngine.h"
26 |
27 | class GLDOPPEyefinityLandscape : public GLDOPPEngine
28 | {
29 | public:
30 | GLDOPPEyefinityLandscape();
31 | ~GLDOPPEyefinityLandscape();
32 |
33 | bool initEffect();
34 | void updateTexture();
35 |
36 | private:
37 |
38 | GLShader* m_pProgram;
39 | GLuint m_uiBasmapLoc;
40 | };
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPEyefinityPortrait.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "StdAfx.h"
24 | #include
25 |
26 | #include "GLDOPPEyefinityPortrait.h"
27 | #include "GLShader.h"
28 |
29 |
30 | GLDOPPEyefinityPortrait::GLDOPPEyefinityPortrait()
31 | : GLDOPPEngine()
32 | , m_pProgram(nullptr)
33 | , m_uiBasmapLoc(0)
34 | {}
35 |
36 |
37 | GLDOPPEyefinityPortrait::~GLDOPPEyefinityPortrait()
38 | {
39 | if (m_pProgram)
40 | {
41 | delete m_pProgram;
42 | }
43 | }
44 |
45 |
46 | bool GLDOPPEyefinityPortrait::initEffect()
47 | {
48 | if (m_pProgram)
49 | {
50 | delete m_pProgram;
51 | }
52 |
53 | m_pProgram = new GLShader;
54 |
55 | if ((!m_pProgram->createVertexShaderFromFile("Shaders/base.vp")) || (!m_pProgram->createFragmentShaderFromFile("Shaders/portrait.fp")))
56 | {
57 | return false;
58 | }
59 |
60 | if (!m_pProgram->buildProgram())
61 | {
62 | return false;
63 | }
64 |
65 | m_uiBasmapLoc = glGetUniformLocation(m_pProgram->getProgram(), "baseMap");
66 |
67 | return true;
68 | }
69 |
70 |
71 | void GLDOPPEyefinityPortrait::updateTexture()
72 | {
73 | glDisable(GL_DEPTH_TEST);
74 |
75 | m_pProgram->bind();
76 |
77 | glActiveTexture(GL_TEXTURE1);
78 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture);
79 |
80 | glUniform1i(m_uiBasmapLoc, 1);
81 |
82 | glBindVertexArray(m_uiVertexArray);
83 | glDrawArrays(GL_TRIANGLES, 0, 3);
84 | glBindVertexArray(0);
85 |
86 | glEnable(GL_DEPTH_TEST);
87 |
88 | m_pProgram->unbind();
89 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPEyefinityPortrait.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | #include "GLDOPPEngine.h"
26 |
27 | class GLDOPPEyefinityPortrait : public GLDOPPEngine
28 | {
29 | public:
30 | GLDOPPEyefinityPortrait();
31 | ~GLDOPPEyefinityPortrait();
32 |
33 | bool initEffect();
34 | void updateTexture();
35 |
36 | private:
37 |
38 | GLShader* m_pProgram;
39 | GLuint m_uiBasmapLoc;
40 | };
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPRotate.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "StdAfx.h"
24 | #include
25 |
26 | #define _USE_MATH_DEFINES
27 | #include
28 |
29 | #include "GLDOPPRotate.h"
30 | #include "GLShader.h"
31 |
32 |
33 | GLDOPPRotate::GLDOPPRotate()
34 | : m_pProgram(nullptr)
35 | , m_uiBasmapLoc(0)
36 | {
37 | // Init model view
38 | memset(m_pModelViewMat, 0, 16 * sizeof(float));
39 |
40 | m_pModelViewMat[0] = 1.0f; // [0][0]
41 | m_pModelViewMat[5] = 1.0f; // [1][1]
42 | m_pModelViewMat[10] = 1.0f; // [2][2]
43 | m_pModelViewMat[15] = 1.0f; // [3][3]
44 |
45 | // Init ortho projection matrix as identity
46 | memset(m_pProjectionMat, 0, 16 * sizeof(float));
47 |
48 | m_pProjectionMat[0] = 1.0f;
49 | m_pProjectionMat[5] = 1.0f;
50 | m_pProjectionMat[10] = 1.0f;
51 | m_pProjectionMat[15] = 1.0f;
52 | }
53 |
54 |
55 | GLDOPPRotate::~GLDOPPRotate()
56 | {
57 | if (m_pProgram)
58 | {
59 | delete m_pProgram;
60 | }
61 |
62 | if (m_uiTransform)
63 | {
64 | glDeleteBuffers(1, &m_uiTransform);
65 | }
66 | }
67 |
68 |
69 | bool GLDOPPRotate::initEffect()
70 | {
71 | if (m_pProgram)
72 | {
73 | delete m_pProgram;
74 | }
75 |
76 | m_pProgram = new GLShader;
77 |
78 | if ((!m_pProgram->createVertexShaderFromFile("Shaders/transform.vp")) || (!m_pProgram->createFragmentShaderFromFile("Shaders/base.fp")))
79 | {
80 | return false;
81 | }
82 |
83 | if (!m_pProgram->buildProgram())
84 | {
85 | return false;
86 | }
87 |
88 | m_uiBasmapLoc = glGetUniformLocation(m_pProgram->getProgram(), "baseMap");
89 |
90 | // create UBO to pass tarnsformation matrix
91 | glGenBuffers(1, &m_uiTransform);
92 |
93 | glBindBuffer(GL_UNIFORM_BUFFER, m_uiTransform);
94 |
95 | glBufferData(GL_UNIFORM_BUFFER, 32 * sizeof(float), m_pModelViewMat, GL_STATIC_DRAW);
96 |
97 | glBufferSubData(GL_UNIFORM_BUFFER, 16 * sizeof(float), 16 * sizeof(float), m_pProjectionMat);
98 |
99 | glBindBuffer(GL_UNIFORM_BUFFER, 0);
100 |
101 | return true;
102 | }
103 |
104 |
105 | void GLDOPPRotate::setRotation(float a)
106 | {
107 | float r = (static_cast(M_PI ) * a) / 180.0f;
108 |
109 | float ar = static_cast(m_uiDesktopWidth) / m_uiDesktopHeight;
110 |
111 | glBindBuffer(GL_UNIFORM_BUFFER, m_uiTransform);
112 |
113 | float* pMat = reinterpret_cast(glMapBufferRange(GL_UNIFORM_BUFFER, 0, 32 * sizeof(float), GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT));
114 |
115 | if (pMat)
116 | {
117 | // Build rotation matrix to rotate quad around z axis and scale y to
118 | // have a quad that matched the AR of the desktop texture
119 | pMat[0] = cosf(r);
120 | pMat[1] = -sinf(r);
121 |
122 | pMat[4] = sinf(r) / ar;
123 | pMat[5] = cosf(r) / ar;
124 |
125 | // Build ortho projection matrix (glOrtho(-1.0f, 1.0f, -1.0f/ar, 1.0f/ar, -1.0f, 1.0f))
126 | // Only Orth[1][1] need to be updated. The ortho frustum needs to match the AR of the desktop
127 | pMat[21] = ar;
128 | }
129 |
130 | glUnmapBuffer(GL_UNIFORM_BUFFER);
131 |
132 | glBindBuffer(GL_UNIFORM_BUFFER, 0);
133 | }
134 |
135 |
136 | void GLDOPPRotate::updateTexture()
137 | {
138 | glDisable(GL_DEPTH_TEST);
139 |
140 | glBindBufferBase(GL_UNIFORM_BUFFER, 0, m_uiTransform);
141 |
142 | m_pProgram->bind();
143 |
144 | glActiveTexture(GL_TEXTURE1);
145 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture);
146 |
147 | glUniform1i(m_uiBasmapLoc, 1);
148 |
149 | glBindVertexArray(m_uiVertexArray);
150 | glDrawArrays(GL_TRIANGLES, 0, 3);
151 | glBindVertexArray(0);
152 |
153 | glEnable(GL_DEPTH_TEST);
154 |
155 | m_pProgram->unbind();
156 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/GLDOPPRotate.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | #include "GLDOPPEngine.h"
26 |
27 | class GLDOPPRotate : public GLDOPPEngine
28 | {
29 | public:
30 |
31 | GLDOPPRotate();
32 | ~GLDOPPRotate();
33 |
34 | bool initEffect();
35 | void updateTexture();
36 |
37 | void setRotation(float a);
38 |
39 | private:
40 |
41 | GLShader* m_pProgram;
42 | GLuint m_uiBasmapLoc;
43 | GLuint m_uiTransform;
44 |
45 | float m_pModelViewMat[16];
46 | float m_pProjectionMat[16];
47 | };
--------------------------------------------------------------------------------
/DOPPEngine/src/GLShader.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "stdafx.h"
24 | #include
25 | #include
26 |
27 | #include "GLShader.h"
28 |
29 | using namespace std;
30 |
31 |
32 | GLShader::GLShader()
33 | : m_uiVertexShader(0)
34 | , m_uiFragmentShader(0)
35 | , m_uiProgram(0)
36 | {
37 | m_strErrorMessage.clear();
38 | }
39 |
40 |
41 | GLShader::~GLShader()
42 | {
43 | glUseProgram(0);
44 |
45 | glDeleteProgram(m_uiProgram);
46 | }
47 |
48 |
49 | bool GLShader::createVertexShaderFromFile(const char* pFileName)
50 | {
51 | if (!createShaderFromFile(pFileName, GL_VERTEX_SHADER))
52 | {
53 | return false;
54 | }
55 |
56 | return true;
57 | }
58 |
59 |
60 | bool GLShader::createFragmentShaderFromFile(const char* pFileName)
61 | {
62 | if (!createShaderFromFile(pFileName, GL_FRAGMENT_SHADER))
63 | {
64 | return false;
65 | }
66 |
67 | return true;
68 | }
69 |
70 |
71 |
72 | bool GLShader::buildProgram()
73 | {
74 | if (!m_uiVertexShader || !m_uiFragmentShader)
75 | {
76 | return false;
77 | }
78 |
79 | if (m_uiProgram)
80 | {
81 | glDeleteProgram(m_uiProgram);
82 | }
83 |
84 | m_uiProgram = glCreateProgram();
85 |
86 | glAttachShader(m_uiProgram, m_uiVertexShader);
87 | glAttachShader(m_uiProgram, m_uiFragmentShader);
88 |
89 | glLinkProgram(m_uiProgram);
90 |
91 | int nStatus;
92 | int nLength;
93 | char cMessage[256];
94 |
95 | glGetProgramiv(m_uiProgram, GL_LINK_STATUS, &nStatus);
96 |
97 | if (nStatus != GL_TRUE)
98 | {
99 | glGetProgramInfoLog(m_uiProgram, 256, &nLength, cMessage);
100 |
101 | m_strErrorMessage = cMessage;
102 |
103 | return false;
104 | }
105 |
106 | return true;
107 | }
108 |
109 |
110 | bool GLShader::createShaderFromFile(const char* pFileName, unsigned int uiType)
111 | {
112 | string strSource;
113 | unsigned int uiShader = 0;
114 |
115 | if (!readShaderSource(pFileName, strSource))
116 | {
117 | return false;
118 | }
119 |
120 | const char* pSource = strSource.c_str();
121 |
122 | if (uiType == GL_VERTEX_SHADER)
123 | {
124 | m_uiVertexShader = glCreateShader(GL_VERTEX_SHADER);
125 |
126 | uiShader = m_uiVertexShader;
127 | }
128 | else if (uiType == GL_FRAGMENT_SHADER)
129 | {
130 | m_uiFragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
131 |
132 | uiShader = m_uiFragmentShader;
133 | }
134 |
135 | glShaderSource(uiShader, 1, &pSource, nullptr);
136 |
137 | glCompileShader(uiShader);
138 |
139 | int nStatus;
140 | int nLength;
141 | char cMessage[256];
142 |
143 | glGetShaderiv(uiShader, GL_COMPILE_STATUS, &nStatus);
144 |
145 | if (nStatus != GL_TRUE)
146 | {
147 | glGetShaderInfoLog(uiShader, 256, &nLength, cMessage);
148 |
149 | m_strErrorMessage = cMessage;
150 |
151 | return false;
152 | }
153 |
154 | return true;
155 | }
156 |
157 |
158 | bool GLShader::readShaderSource(const char* pFileName, std::string &strSource)
159 | {
160 | string strLine;
161 | ifstream ShaderFile(pFileName);
162 |
163 | if (!ShaderFile.is_open())
164 | {
165 | return false;
166 | }
167 |
168 | while(!ShaderFile.eof())
169 | {
170 | getline(ShaderFile, strLine);
171 | strSource += strLine;
172 | strSource += "\n";
173 | }
174 |
175 | return true;
176 | }
--------------------------------------------------------------------------------
/DOPPEngine/src/GLShader.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #pragma once
24 |
25 | #include
26 |
27 | class GLShader
28 | {
29 | public:
30 |
31 | GLShader();
32 | virtual ~GLShader();
33 |
34 | bool createVertexShaderFromFile(const char* pFileName);
35 | bool createFragmentShaderFromFile(const char* pFileName);
36 |
37 | bool buildProgram();
38 |
39 | void bind() { glUseProgram(m_uiProgram); };
40 | void unbind() { glUseProgram(0); };
41 |
42 | unsigned int getProgram() { return m_uiProgram; };
43 | const char* getErrorMessage() { return m_strErrorMessage.c_str(); };
44 |
45 | private:
46 |
47 | bool readShaderSource(const char* pFileName, std::string &strSource);
48 | bool createShaderFromFile(const char* pFileName, unsigned int uiType);
49 |
50 | unsigned int m_uiVertexShader;
51 | unsigned int m_uiFragmentShader;
52 | unsigned int m_uiProgram;
53 |
54 | std::string m_strErrorMessage;
55 |
56 | };
--------------------------------------------------------------------------------
/DOPPEngine/src/stdafx.cpp:
--------------------------------------------------------------------------------
1 |
2 | // stdafx.cpp : source file that includes just the standard includes
3 | // DOPPEngine.pch will be the pre-compiled header
4 | // stdafx.obj will contain the pre-compiled type information
5 |
6 | #include "stdafx.h"
7 |
8 |
9 |
--------------------------------------------------------------------------------
/DOPPEngine/src/stdafx.h:
--------------------------------------------------------------------------------
1 |
2 | // stdafx.h : include file for standard system include files,
3 | // or project specific include files that are used frequently,
4 | // but are changed infrequently
5 |
6 | #pragma once
7 |
8 | #ifndef _SECURE_ATL
9 | #define _SECURE_ATL 1
10 | #endif
11 |
12 | #ifndef VC_EXTRALEAN
13 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
14 | #endif
15 |
16 | #include "targetver.h"
17 |
18 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
19 |
20 | // turns off MFC's hiding of some common and often safely ignored warning messages
21 | #define _AFX_ALL_WARNINGS
22 |
23 | #include // MFC core and standard components
24 | #include // MFC extensions
25 |
26 |
27 |
28 |
29 |
30 | #ifndef _AFX_NO_OLE_SUPPORT
31 | #include // MFC support for Internet Explorer 4 Common Controls
32 | #endif
33 | #ifndef _AFX_NO_AFXCMN_SUPPORT
34 | #include // MFC support for Windows Common Controls
35 | #endif // _AFX_NO_AFXCMN_SUPPORT
36 |
37 | #include // MFC support for ribbons and control bars
38 |
39 |
40 |
41 |
42 |
43 | #ifdef _UNICODE
44 | #if defined _M_IX86
45 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
46 | #elif defined _M_X64
47 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
48 | #else
49 | #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
50 | #endif
51 | #endif
52 |
53 |
54 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DOPPEngine
2 |
3 | DOPPEngine demonstrates how to utilize the Display Output Post-Processing (DOPP) to create various effects manipulating the desktop before it is displayed.
4 |
5 | **The following effects can be selected:**
6 | * **Eyefinity Landscape / Portrait** can be used to divide an SLS surface horizontally or vertically and rotate the respective portion 180°. This allows multi-display users with panels having a narrow bezel or being bezeless on the left, right and top side to create a near seamless surface.
7 |
8 | 
9 |
10 |
11 | * **Invert Colors** displays the desktop with inverted colors
12 | * **Edge Filter** uses an edge detection shader based on laplacian edge detection to highlight the edges on the screen
13 | * **Distort** applies a shader that dynamically distorts the captured screen
14 | * **Rotate** lets you select an angle by which the desktop gets rotated
15 |
16 | ### Prerequisites
17 | * AMD FirePro™ GCN-based GPU
18 | * Windows® 7, Windows® 8.1, or Windows® 10
19 | * Visual Studio® 2012
20 |
21 | ### Getting Started
22 | * Visual Studio solution for VS2012 can be found in the DOPPEngine directory.
23 |
24 | ### Attribution
25 | * AMD, the AMD Arrow logo, FirePro, and combinations thereof are either registered trademarks or trademarks of Advanced Micro Devices, Inc. in the United States and/or other countries.
26 | * Microsoft, Visual Studio, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
--------------------------------------------------------------------------------
/external/ADL/adl_sdk.h:
--------------------------------------------------------------------------------
1 | ///
2 | /// Copyright (c) 2008 - 2013 Advanced Micro Devices, Inc.
3 |
4 | /// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
5 | /// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
6 | /// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
7 |
8 | /// \file adl_sdk.h
9 | /// \brief Contains the definition of the Memory Allocation Callback.\n Included in ADL SDK
10 | ///
11 | /// \n\n
12 | /// This file contains the definition of the Memory Allocation Callback.\n
13 | /// It also includes definitions of the respective structures and constants.\n
14 | /// This is the only header file to be included in a C/C++ project using ADL
15 |
16 | #ifndef ADL_SDK_H_
17 | #define ADL_SDK_H_
18 |
19 | #include "adl_structures.h"
20 |
21 | #if defined (LINUX)
22 | #define __stdcall
23 | #endif /* (LINUX) */
24 |
25 | /// Memory Allocation Call back
26 | typedef void* ( __stdcall *ADL_MAIN_MALLOC_CALLBACK )( int );
27 |
28 |
29 | #endif /* ADL_SDK_H_ */
30 |
--------------------------------------------------------------------------------
/external/GLEW/include/GL/wglew.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** The OpenGL Extension Wrangler Library
3 | ** Copyright (C) 2008-2015, Nigel Stewart
4 | ** Copyright (C) 2002-2008, Milan Ikits
5 | ** Copyright (C) 2002-2008, Marcelo E. Magallon
6 | ** Copyright (C) 2002, Lev Povalahev
7 | ** All rights reserved.
8 | **
9 | ** Redistribution and use in source and binary forms, with or without
10 | ** modification, are permitted provided that the following conditions are met:
11 | **
12 | ** * Redistributions of source code must retain the above copyright notice,
13 | ** this list of conditions and the following disclaimer.
14 | ** * Redistributions in binary form must reproduce the above copyright notice,
15 | ** this list of conditions and the following disclaimer in the documentation
16 | ** and/or other materials provided with the distribution.
17 | ** * The name of the author may be used to endorse or promote products
18 | ** derived from this software without specific prior written permission.
19 | **
20 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 | ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 | ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 | ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 | ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 | ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 | ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 | ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 | ** THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | /*
34 | ** Copyright (c) 2007 The Khronos Group Inc.
35 | **
36 | ** Permission is hereby granted, free of charge, to any person obtaining a
37 | ** copy of this software and/or associated documentation files (the
38 | ** "Materials"), to deal in the Materials without restriction, including
39 | ** without limitation the rights to use, copy, modify, merge, publish,
40 | ** distribute, sublicense, and/or sell copies of the Materials, and to
41 | ** permit persons to whom the Materials are furnished to do so, subject to
42 | ** the following conditions:
43 | **
44 | ** The above copyright notice and this permission notice shall be included
45 | ** in all copies or substantial portions of the Materials.
46 | **
47 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
48 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
49 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
50 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
51 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
52 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
53 | ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
54 | */
55 |
56 | #ifndef __wglew_h__
57 | #define __wglew_h__
58 | #define __WGLEW_H__
59 |
60 | #ifdef __wglext_h_
61 | #error wglext.h included before wglew.h
62 | #endif
63 |
64 | #define __wglext_h_
65 |
66 | #if !defined(WINAPI)
67 | # ifndef WIN32_LEAN_AND_MEAN
68 | # define WIN32_LEAN_AND_MEAN 1
69 | # endif
70 | #include
71 | # undef WIN32_LEAN_AND_MEAN
72 | #endif
73 |
74 | /*
75 | * GLEW_STATIC needs to be set when using the static version.
76 | * GLEW_BUILD is set when building the DLL version.
77 | */
78 | #ifdef GLEW_STATIC
79 | # define GLEWAPI extern
80 | #else
81 | # ifdef GLEW_BUILD
82 | # define GLEWAPI extern __declspec(dllexport)
83 | # else
84 | # define GLEWAPI extern __declspec(dllimport)
85 | # endif
86 | #endif
87 |
88 | #ifdef __cplusplus
89 | extern "C" {
90 | #endif
91 |
92 | /* -------------------------- WGL_3DFX_multisample ------------------------- */
93 |
94 | #ifndef WGL_3DFX_multisample
95 | #define WGL_3DFX_multisample 1
96 |
97 | #define WGL_SAMPLE_BUFFERS_3DFX 0x2060
98 | #define WGL_SAMPLES_3DFX 0x2061
99 |
100 | #define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample)
101 |
102 | #endif /* WGL_3DFX_multisample */
103 |
104 | /* ------------------------- WGL_3DL_stereo_control ------------------------ */
105 |
106 | #ifndef WGL_3DL_stereo_control
107 | #define WGL_3DL_stereo_control 1
108 |
109 | #define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
110 | #define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
111 | #define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
112 | #define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
113 |
114 | typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
115 |
116 | #define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL)
117 |
118 | #define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control)
119 |
120 | #endif /* WGL_3DL_stereo_control */
121 |
122 | /* ------------------------ WGL_AMD_gpu_association ------------------------ */
123 |
124 | #ifndef WGL_AMD_gpu_association
125 | #define WGL_AMD_gpu_association 1
126 |
127 | #define WGL_GPU_VENDOR_AMD 0x1F00
128 | #define WGL_GPU_RENDERER_STRING_AMD 0x1F01
129 | #define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
130 | #define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
131 | #define WGL_GPU_RAM_AMD 0x21A3
132 | #define WGL_GPU_CLOCK_AMD 0x21A4
133 | #define WGL_GPU_NUM_PIPES_AMD 0x21A5
134 | #define WGL_GPU_NUM_SIMD_AMD 0x21A6
135 | #define WGL_GPU_NUM_RB_AMD 0x21A7
136 | #define WGL_GPU_NUM_SPI_AMD 0x21A8
137 |
138 | typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
139 | typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
140 | typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList);
141 | typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
142 | typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
143 | typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
144 | typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids);
145 | typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data);
146 | typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
147 |
148 | #define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD)
149 | #define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD)
150 | #define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD)
151 | #define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD)
152 | #define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD)
153 | #define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD)
154 | #define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD)
155 | #define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD)
156 | #define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD)
157 |
158 | #define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association)
159 |
160 | #endif /* WGL_AMD_gpu_association */
161 |
162 | /* ------------------------- WGL_ARB_buffer_region ------------------------- */
163 |
164 | #ifndef WGL_ARB_buffer_region
165 | #define WGL_ARB_buffer_region 1
166 |
167 | #define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
168 | #define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
169 | #define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
170 | #define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
171 |
172 | typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
173 | typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
174 | typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
175 | typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
176 |
177 | #define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB)
178 | #define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB)
179 | #define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB)
180 | #define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB)
181 |
182 | #define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region)
183 |
184 | #endif /* WGL_ARB_buffer_region */
185 |
186 | /* --------------------- WGL_ARB_context_flush_control --------------------- */
187 |
188 | #ifndef WGL_ARB_context_flush_control
189 | #define WGL_ARB_context_flush_control 1
190 |
191 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000
192 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
193 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
194 |
195 | #define WGLEW_ARB_context_flush_control WGLEW_GET_VAR(__WGLEW_ARB_context_flush_control)
196 |
197 | #endif /* WGL_ARB_context_flush_control */
198 |
199 | /* ------------------------- WGL_ARB_create_context ------------------------ */
200 |
201 | #ifndef WGL_ARB_create_context
202 | #define WGL_ARB_create_context 1
203 |
204 | #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
205 | #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
206 | #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
207 | #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
208 | #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
209 | #define WGL_CONTEXT_FLAGS_ARB 0x2094
210 | #define ERROR_INVALID_VERSION_ARB 0x2095
211 | #define ERROR_INVALID_PROFILE_ARB 0x2096
212 |
213 | typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList);
214 |
215 | #define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB)
216 |
217 | #define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context)
218 |
219 | #endif /* WGL_ARB_create_context */
220 |
221 | /* --------------------- WGL_ARB_create_context_profile -------------------- */
222 |
223 | #ifndef WGL_ARB_create_context_profile
224 | #define WGL_ARB_create_context_profile 1
225 |
226 | #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
227 | #define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
228 | #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
229 |
230 | #define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile)
231 |
232 | #endif /* WGL_ARB_create_context_profile */
233 |
234 | /* ------------------- WGL_ARB_create_context_robustness ------------------- */
235 |
236 | #ifndef WGL_ARB_create_context_robustness
237 | #define WGL_ARB_create_context_robustness 1
238 |
239 | #define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
240 | #define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
241 | #define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
242 | #define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
243 |
244 | #define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness)
245 |
246 | #endif /* WGL_ARB_create_context_robustness */
247 |
248 | /* ----------------------- WGL_ARB_extensions_string ----------------------- */
249 |
250 | #ifndef WGL_ARB_extensions_string
251 | #define WGL_ARB_extensions_string 1
252 |
253 | typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
254 |
255 | #define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB)
256 |
257 | #define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string)
258 |
259 | #endif /* WGL_ARB_extensions_string */
260 |
261 | /* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */
262 |
263 | #ifndef WGL_ARB_framebuffer_sRGB
264 | #define WGL_ARB_framebuffer_sRGB 1
265 |
266 | #define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
267 |
268 | #define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB)
269 |
270 | #endif /* WGL_ARB_framebuffer_sRGB */
271 |
272 | /* ----------------------- WGL_ARB_make_current_read ----------------------- */
273 |
274 | #ifndef WGL_ARB_make_current_read
275 | #define WGL_ARB_make_current_read 1
276 |
277 | #define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
278 | #define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
279 |
280 | typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID);
281 | typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
282 |
283 | #define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB)
284 | #define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB)
285 |
286 | #define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read)
287 |
288 | #endif /* WGL_ARB_make_current_read */
289 |
290 | /* -------------------------- WGL_ARB_multisample -------------------------- */
291 |
292 | #ifndef WGL_ARB_multisample
293 | #define WGL_ARB_multisample 1
294 |
295 | #define WGL_SAMPLE_BUFFERS_ARB 0x2041
296 | #define WGL_SAMPLES_ARB 0x2042
297 |
298 | #define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample)
299 |
300 | #endif /* WGL_ARB_multisample */
301 |
302 | /* ---------------------------- WGL_ARB_pbuffer ---------------------------- */
303 |
304 | #ifndef WGL_ARB_pbuffer
305 | #define WGL_ARB_pbuffer 1
306 |
307 | #define WGL_DRAW_TO_PBUFFER_ARB 0x202D
308 | #define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
309 | #define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
310 | #define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
311 | #define WGL_PBUFFER_LARGEST_ARB 0x2033
312 | #define WGL_PBUFFER_WIDTH_ARB 0x2034
313 | #define WGL_PBUFFER_HEIGHT_ARB 0x2035
314 | #define WGL_PBUFFER_LOST_ARB 0x2036
315 |
316 | DECLARE_HANDLE(HPBUFFERARB);
317 |
318 | typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
319 | typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
320 | typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
321 | typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue);
322 | typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
323 |
324 | #define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB)
325 | #define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB)
326 | #define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB)
327 | #define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB)
328 | #define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB)
329 |
330 | #define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer)
331 |
332 | #endif /* WGL_ARB_pbuffer */
333 |
334 | /* -------------------------- WGL_ARB_pixel_format ------------------------- */
335 |
336 | #ifndef WGL_ARB_pixel_format
337 | #define WGL_ARB_pixel_format 1
338 |
339 | #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
340 | #define WGL_DRAW_TO_WINDOW_ARB 0x2001
341 | #define WGL_DRAW_TO_BITMAP_ARB 0x2002
342 | #define WGL_ACCELERATION_ARB 0x2003
343 | #define WGL_NEED_PALETTE_ARB 0x2004
344 | #define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
345 | #define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
346 | #define WGL_SWAP_METHOD_ARB 0x2007
347 | #define WGL_NUMBER_OVERLAYS_ARB 0x2008
348 | #define WGL_NUMBER_UNDERLAYS_ARB 0x2009
349 | #define WGL_TRANSPARENT_ARB 0x200A
350 | #define WGL_SHARE_DEPTH_ARB 0x200C
351 | #define WGL_SHARE_STENCIL_ARB 0x200D
352 | #define WGL_SHARE_ACCUM_ARB 0x200E
353 | #define WGL_SUPPORT_GDI_ARB 0x200F
354 | #define WGL_SUPPORT_OPENGL_ARB 0x2010
355 | #define WGL_DOUBLE_BUFFER_ARB 0x2011
356 | #define WGL_STEREO_ARB 0x2012
357 | #define WGL_PIXEL_TYPE_ARB 0x2013
358 | #define WGL_COLOR_BITS_ARB 0x2014
359 | #define WGL_RED_BITS_ARB 0x2015
360 | #define WGL_RED_SHIFT_ARB 0x2016
361 | #define WGL_GREEN_BITS_ARB 0x2017
362 | #define WGL_GREEN_SHIFT_ARB 0x2018
363 | #define WGL_BLUE_BITS_ARB 0x2019
364 | #define WGL_BLUE_SHIFT_ARB 0x201A
365 | #define WGL_ALPHA_BITS_ARB 0x201B
366 | #define WGL_ALPHA_SHIFT_ARB 0x201C
367 | #define WGL_ACCUM_BITS_ARB 0x201D
368 | #define WGL_ACCUM_RED_BITS_ARB 0x201E
369 | #define WGL_ACCUM_GREEN_BITS_ARB 0x201F
370 | #define WGL_ACCUM_BLUE_BITS_ARB 0x2020
371 | #define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
372 | #define WGL_DEPTH_BITS_ARB 0x2022
373 | #define WGL_STENCIL_BITS_ARB 0x2023
374 | #define WGL_AUX_BUFFERS_ARB 0x2024
375 | #define WGL_NO_ACCELERATION_ARB 0x2025
376 | #define WGL_GENERIC_ACCELERATION_ARB 0x2026
377 | #define WGL_FULL_ACCELERATION_ARB 0x2027
378 | #define WGL_SWAP_EXCHANGE_ARB 0x2028
379 | #define WGL_SWAP_COPY_ARB 0x2029
380 | #define WGL_SWAP_UNDEFINED_ARB 0x202A
381 | #define WGL_TYPE_RGBA_ARB 0x202B
382 | #define WGL_TYPE_COLORINDEX_ARB 0x202C
383 | #define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
384 | #define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
385 | #define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
386 | #define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
387 | #define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
388 |
389 | typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
390 | typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues);
391 | typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues);
392 |
393 | #define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB)
394 | #define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB)
395 | #define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB)
396 |
397 | #define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format)
398 |
399 | #endif /* WGL_ARB_pixel_format */
400 |
401 | /* ----------------------- WGL_ARB_pixel_format_float ---------------------- */
402 |
403 | #ifndef WGL_ARB_pixel_format_float
404 | #define WGL_ARB_pixel_format_float 1
405 |
406 | #define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
407 |
408 | #define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float)
409 |
410 | #endif /* WGL_ARB_pixel_format_float */
411 |
412 | /* ------------------------- WGL_ARB_render_texture ------------------------ */
413 |
414 | #ifndef WGL_ARB_render_texture
415 | #define WGL_ARB_render_texture 1
416 |
417 | #define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
418 | #define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
419 | #define WGL_TEXTURE_FORMAT_ARB 0x2072
420 | #define WGL_TEXTURE_TARGET_ARB 0x2073
421 | #define WGL_MIPMAP_TEXTURE_ARB 0x2074
422 | #define WGL_TEXTURE_RGB_ARB 0x2075
423 | #define WGL_TEXTURE_RGBA_ARB 0x2076
424 | #define WGL_NO_TEXTURE_ARB 0x2077
425 | #define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
426 | #define WGL_TEXTURE_1D_ARB 0x2079
427 | #define WGL_TEXTURE_2D_ARB 0x207A
428 | #define WGL_MIPMAP_LEVEL_ARB 0x207B
429 | #define WGL_CUBE_MAP_FACE_ARB 0x207C
430 | #define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
431 | #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
432 | #define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
433 | #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
434 | #define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
435 | #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
436 | #define WGL_FRONT_LEFT_ARB 0x2083
437 | #define WGL_FRONT_RIGHT_ARB 0x2084
438 | #define WGL_BACK_LEFT_ARB 0x2085
439 | #define WGL_BACK_RIGHT_ARB 0x2086
440 | #define WGL_AUX0_ARB 0x2087
441 | #define WGL_AUX1_ARB 0x2088
442 | #define WGL_AUX2_ARB 0x2089
443 | #define WGL_AUX3_ARB 0x208A
444 | #define WGL_AUX4_ARB 0x208B
445 | #define WGL_AUX5_ARB 0x208C
446 | #define WGL_AUX6_ARB 0x208D
447 | #define WGL_AUX7_ARB 0x208E
448 | #define WGL_AUX8_ARB 0x208F
449 | #define WGL_AUX9_ARB 0x2090
450 |
451 | typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
452 | typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
453 | typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList);
454 |
455 | #define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB)
456 | #define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB)
457 | #define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB)
458 |
459 | #define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture)
460 |
461 | #endif /* WGL_ARB_render_texture */
462 |
463 | /* ---------------- WGL_ARB_robustness_application_isolation --------------- */
464 |
465 | #ifndef WGL_ARB_robustness_application_isolation
466 | #define WGL_ARB_robustness_application_isolation 1
467 |
468 | #define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
469 |
470 | #define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation)
471 |
472 | #endif /* WGL_ARB_robustness_application_isolation */
473 |
474 | /* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */
475 |
476 | #ifndef WGL_ARB_robustness_share_group_isolation
477 | #define WGL_ARB_robustness_share_group_isolation 1
478 |
479 | #define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
480 |
481 | #define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation)
482 |
483 | #endif /* WGL_ARB_robustness_share_group_isolation */
484 |
485 | /* ----------------------- WGL_ATI_pixel_format_float ---------------------- */
486 |
487 | #ifndef WGL_ATI_pixel_format_float
488 | #define WGL_ATI_pixel_format_float 1
489 |
490 | #define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
491 | #define GL_RGBA_FLOAT_MODE_ATI 0x8820
492 | #define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
493 |
494 | #define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float)
495 |
496 | #endif /* WGL_ATI_pixel_format_float */
497 |
498 | /* -------------------- WGL_ATI_render_texture_rectangle ------------------- */
499 |
500 | #ifndef WGL_ATI_render_texture_rectangle
501 | #define WGL_ATI_render_texture_rectangle 1
502 |
503 | #define WGL_TEXTURE_RECTANGLE_ATI 0x21A5
504 |
505 | #define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle)
506 |
507 | #endif /* WGL_ATI_render_texture_rectangle */
508 |
509 | /* ------------------- WGL_EXT_create_context_es2_profile ------------------ */
510 |
511 | #ifndef WGL_EXT_create_context_es2_profile
512 | #define WGL_EXT_create_context_es2_profile 1
513 |
514 | #define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
515 |
516 | #define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile)
517 |
518 | #endif /* WGL_EXT_create_context_es2_profile */
519 |
520 | /* ------------------- WGL_EXT_create_context_es_profile ------------------- */
521 |
522 | #ifndef WGL_EXT_create_context_es_profile
523 | #define WGL_EXT_create_context_es_profile 1
524 |
525 | #define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
526 |
527 | #define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile)
528 |
529 | #endif /* WGL_EXT_create_context_es_profile */
530 |
531 | /* -------------------------- WGL_EXT_depth_float -------------------------- */
532 |
533 | #ifndef WGL_EXT_depth_float
534 | #define WGL_EXT_depth_float 1
535 |
536 | #define WGL_DEPTH_FLOAT_EXT 0x2040
537 |
538 | #define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float)
539 |
540 | #endif /* WGL_EXT_depth_float */
541 |
542 | /* ---------------------- WGL_EXT_display_color_table ---------------------- */
543 |
544 | #ifndef WGL_EXT_display_color_table
545 | #define WGL_EXT_display_color_table 1
546 |
547 | typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
548 | typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
549 | typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
550 | typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length);
551 |
552 | #define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT)
553 | #define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT)
554 | #define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT)
555 | #define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT)
556 |
557 | #define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table)
558 |
559 | #endif /* WGL_EXT_display_color_table */
560 |
561 | /* ----------------------- WGL_EXT_extensions_string ----------------------- */
562 |
563 | #ifndef WGL_EXT_extensions_string
564 | #define WGL_EXT_extensions_string 1
565 |
566 | typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
567 |
568 | #define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT)
569 |
570 | #define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string)
571 |
572 | #endif /* WGL_EXT_extensions_string */
573 |
574 | /* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */
575 |
576 | #ifndef WGL_EXT_framebuffer_sRGB
577 | #define WGL_EXT_framebuffer_sRGB 1
578 |
579 | #define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
580 |
581 | #define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB)
582 |
583 | #endif /* WGL_EXT_framebuffer_sRGB */
584 |
585 | /* ----------------------- WGL_EXT_make_current_read ----------------------- */
586 |
587 | #ifndef WGL_EXT_make_current_read
588 | #define WGL_EXT_make_current_read 1
589 |
590 | #define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
591 |
592 | typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID);
593 | typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
594 |
595 | #define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT)
596 | #define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT)
597 |
598 | #define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read)
599 |
600 | #endif /* WGL_EXT_make_current_read */
601 |
602 | /* -------------------------- WGL_EXT_multisample -------------------------- */
603 |
604 | #ifndef WGL_EXT_multisample
605 | #define WGL_EXT_multisample 1
606 |
607 | #define WGL_SAMPLE_BUFFERS_EXT 0x2041
608 | #define WGL_SAMPLES_EXT 0x2042
609 |
610 | #define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample)
611 |
612 | #endif /* WGL_EXT_multisample */
613 |
614 | /* ---------------------------- WGL_EXT_pbuffer ---------------------------- */
615 |
616 | #ifndef WGL_EXT_pbuffer
617 | #define WGL_EXT_pbuffer 1
618 |
619 | #define WGL_DRAW_TO_PBUFFER_EXT 0x202D
620 | #define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
621 | #define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
622 | #define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
623 | #define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
624 | #define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
625 | #define WGL_PBUFFER_LARGEST_EXT 0x2033
626 | #define WGL_PBUFFER_WIDTH_EXT 0x2034
627 | #define WGL_PBUFFER_HEIGHT_EXT 0x2035
628 |
629 | DECLARE_HANDLE(HPBUFFEREXT);
630 |
631 | typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
632 | typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
633 | typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
634 | typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue);
635 | typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
636 |
637 | #define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT)
638 | #define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT)
639 | #define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT)
640 | #define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT)
641 | #define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT)
642 |
643 | #define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer)
644 |
645 | #endif /* WGL_EXT_pbuffer */
646 |
647 | /* -------------------------- WGL_EXT_pixel_format ------------------------- */
648 |
649 | #ifndef WGL_EXT_pixel_format
650 | #define WGL_EXT_pixel_format 1
651 |
652 | #define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
653 | #define WGL_DRAW_TO_WINDOW_EXT 0x2001
654 | #define WGL_DRAW_TO_BITMAP_EXT 0x2002
655 | #define WGL_ACCELERATION_EXT 0x2003
656 | #define WGL_NEED_PALETTE_EXT 0x2004
657 | #define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
658 | #define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
659 | #define WGL_SWAP_METHOD_EXT 0x2007
660 | #define WGL_NUMBER_OVERLAYS_EXT 0x2008
661 | #define WGL_NUMBER_UNDERLAYS_EXT 0x2009
662 | #define WGL_TRANSPARENT_EXT 0x200A
663 | #define WGL_TRANSPARENT_VALUE_EXT 0x200B
664 | #define WGL_SHARE_DEPTH_EXT 0x200C
665 | #define WGL_SHARE_STENCIL_EXT 0x200D
666 | #define WGL_SHARE_ACCUM_EXT 0x200E
667 | #define WGL_SUPPORT_GDI_EXT 0x200F
668 | #define WGL_SUPPORT_OPENGL_EXT 0x2010
669 | #define WGL_DOUBLE_BUFFER_EXT 0x2011
670 | #define WGL_STEREO_EXT 0x2012
671 | #define WGL_PIXEL_TYPE_EXT 0x2013
672 | #define WGL_COLOR_BITS_EXT 0x2014
673 | #define WGL_RED_BITS_EXT 0x2015
674 | #define WGL_RED_SHIFT_EXT 0x2016
675 | #define WGL_GREEN_BITS_EXT 0x2017
676 | #define WGL_GREEN_SHIFT_EXT 0x2018
677 | #define WGL_BLUE_BITS_EXT 0x2019
678 | #define WGL_BLUE_SHIFT_EXT 0x201A
679 | #define WGL_ALPHA_BITS_EXT 0x201B
680 | #define WGL_ALPHA_SHIFT_EXT 0x201C
681 | #define WGL_ACCUM_BITS_EXT 0x201D
682 | #define WGL_ACCUM_RED_BITS_EXT 0x201E
683 | #define WGL_ACCUM_GREEN_BITS_EXT 0x201F
684 | #define WGL_ACCUM_BLUE_BITS_EXT 0x2020
685 | #define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
686 | #define WGL_DEPTH_BITS_EXT 0x2022
687 | #define WGL_STENCIL_BITS_EXT 0x2023
688 | #define WGL_AUX_BUFFERS_EXT 0x2024
689 | #define WGL_NO_ACCELERATION_EXT 0x2025
690 | #define WGL_GENERIC_ACCELERATION_EXT 0x2026
691 | #define WGL_FULL_ACCELERATION_EXT 0x2027
692 | #define WGL_SWAP_EXCHANGE_EXT 0x2028
693 | #define WGL_SWAP_COPY_EXT 0x2029
694 | #define WGL_SWAP_UNDEFINED_EXT 0x202A
695 | #define WGL_TYPE_RGBA_EXT 0x202B
696 | #define WGL_TYPE_COLORINDEX_EXT 0x202C
697 |
698 | typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
699 | typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues);
700 | typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues);
701 |
702 | #define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT)
703 | #define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT)
704 | #define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT)
705 |
706 | #define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format)
707 |
708 | #endif /* WGL_EXT_pixel_format */
709 |
710 | /* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */
711 |
712 | #ifndef WGL_EXT_pixel_format_packed_float
713 | #define WGL_EXT_pixel_format_packed_float 1
714 |
715 | #define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
716 |
717 | #define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float)
718 |
719 | #endif /* WGL_EXT_pixel_format_packed_float */
720 |
721 | /* -------------------------- WGL_EXT_swap_control ------------------------- */
722 |
723 | #ifndef WGL_EXT_swap_control
724 | #define WGL_EXT_swap_control 1
725 |
726 | typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
727 | typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
728 |
729 | #define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT)
730 | #define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT)
731 |
732 | #define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control)
733 |
734 | #endif /* WGL_EXT_swap_control */
735 |
736 | /* ----------------------- WGL_EXT_swap_control_tear ----------------------- */
737 |
738 | #ifndef WGL_EXT_swap_control_tear
739 | #define WGL_EXT_swap_control_tear 1
740 |
741 | #define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear)
742 |
743 | #endif /* WGL_EXT_swap_control_tear */
744 |
745 | /* --------------------- WGL_I3D_digital_video_control --------------------- */
746 |
747 | #ifndef WGL_I3D_digital_video_control
748 | #define WGL_I3D_digital_video_control 1
749 |
750 | #define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
751 | #define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
752 | #define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
753 | #define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
754 |
755 | typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);
756 | typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);
757 |
758 | #define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D)
759 | #define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D)
760 |
761 | #define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control)
762 |
763 | #endif /* WGL_I3D_digital_video_control */
764 |
765 | /* ----------------------------- WGL_I3D_gamma ----------------------------- */
766 |
767 | #ifndef WGL_I3D_gamma
768 | #define WGL_I3D_gamma 1
769 |
770 | #define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
771 | #define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
772 |
773 | typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue);
774 | typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);
775 | typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue);
776 | typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);
777 |
778 | #define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D)
779 | #define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D)
780 | #define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D)
781 | #define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D)
782 |
783 | #define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma)
784 |
785 | #endif /* WGL_I3D_gamma */
786 |
787 | /* ---------------------------- WGL_I3D_genlock ---------------------------- */
788 |
789 | #ifndef WGL_I3D_genlock
790 | #define WGL_I3D_genlock 1
791 |
792 | #define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
793 | #define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
794 | #define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
795 | #define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
796 | #define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
797 | #define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
798 | #define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
799 | #define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
800 | #define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
801 |
802 | typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
803 | typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
804 | typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
805 | typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
806 | typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
807 | typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
808 | typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate);
809 | typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay);
810 | typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge);
811 | typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource);
812 | typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag);
813 | typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay);
814 |
815 | #define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D)
816 | #define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D)
817 | #define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D)
818 | #define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D)
819 | #define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D)
820 | #define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D)
821 | #define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D)
822 | #define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D)
823 | #define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D)
824 | #define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D)
825 | #define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D)
826 | #define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D)
827 |
828 | #define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock)
829 |
830 | #endif /* WGL_I3D_genlock */
831 |
832 | /* -------------------------- WGL_I3D_image_buffer ------------------------- */
833 |
834 | #ifndef WGL_I3D_image_buffer
835 | #define WGL_I3D_image_buffer 1
836 |
837 | #define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
838 | #define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
839 |
840 | typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count);
841 | typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
842 | typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
843 | typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count);
844 |
845 | #define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D)
846 | #define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D)
847 | #define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D)
848 | #define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D)
849 |
850 | #define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer)
851 |
852 | #endif /* WGL_I3D_image_buffer */
853 |
854 | /* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */
855 |
856 | #ifndef WGL_I3D_swap_frame_lock
857 | #define WGL_I3D_swap_frame_lock 1
858 |
859 | typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID);
860 | typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID);
861 | typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag);
862 | typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag);
863 |
864 | #define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D)
865 | #define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D)
866 | #define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D)
867 | #define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D)
868 |
869 | #define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock)
870 |
871 | #endif /* WGL_I3D_swap_frame_lock */
872 |
873 | /* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */
874 |
875 | #ifndef WGL_I3D_swap_frame_usage
876 | #define WGL_I3D_swap_frame_usage 1
877 |
878 | typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
879 | typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
880 | typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage);
881 | typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
882 |
883 | #define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D)
884 | #define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D)
885 | #define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D)
886 | #define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D)
887 |
888 | #define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage)
889 |
890 | #endif /* WGL_I3D_swap_frame_usage */
891 |
892 | /* --------------------------- WGL_NV_DX_interop --------------------------- */
893 |
894 | #ifndef WGL_NV_DX_interop
895 | #define WGL_NV_DX_interop 1
896 |
897 | #define WGL_ACCESS_READ_ONLY_NV 0x0000
898 | #define WGL_ACCESS_READ_WRITE_NV 0x0001
899 | #define WGL_ACCESS_WRITE_DISCARD_NV 0x0002
900 |
901 | typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
902 | typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);
903 | typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
904 | typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice);
905 | typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access);
906 | typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle);
907 | typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);
908 | typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
909 |
910 | #define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV)
911 | #define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV)
912 | #define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV)
913 | #define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV)
914 | #define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV)
915 | #define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV)
916 | #define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV)
917 | #define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV)
918 |
919 | #define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop)
920 |
921 | #endif /* WGL_NV_DX_interop */
922 |
923 | /* --------------------------- WGL_NV_DX_interop2 -------------------------- */
924 |
925 | #ifndef WGL_NV_DX_interop2
926 | #define WGL_NV_DX_interop2 1
927 |
928 | #define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2)
929 |
930 | #endif /* WGL_NV_DX_interop2 */
931 |
932 | /* --------------------------- WGL_NV_copy_image --------------------------- */
933 |
934 | #ifndef WGL_NV_copy_image
935 | #define WGL_NV_copy_image 1
936 |
937 | typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
938 |
939 | #define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV)
940 |
941 | #define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image)
942 |
943 | #endif /* WGL_NV_copy_image */
944 |
945 | /* ------------------------ WGL_NV_delay_before_swap ----------------------- */
946 |
947 | #ifndef WGL_NV_delay_before_swap
948 | #define WGL_NV_delay_before_swap 1
949 |
950 | typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds);
951 |
952 | #define wglDelayBeforeSwapNV WGLEW_GET_FUN(__wglewDelayBeforeSwapNV)
953 |
954 | #define WGLEW_NV_delay_before_swap WGLEW_GET_VAR(__WGLEW_NV_delay_before_swap)
955 |
956 | #endif /* WGL_NV_delay_before_swap */
957 |
958 | /* -------------------------- WGL_NV_float_buffer -------------------------- */
959 |
960 | #ifndef WGL_NV_float_buffer
961 | #define WGL_NV_float_buffer 1
962 |
963 | #define WGL_FLOAT_COMPONENTS_NV 0x20B0
964 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
965 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
966 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
967 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
968 | #define WGL_TEXTURE_FLOAT_R_NV 0x20B5
969 | #define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
970 | #define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
971 | #define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
972 |
973 | #define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer)
974 |
975 | #endif /* WGL_NV_float_buffer */
976 |
977 | /* -------------------------- WGL_NV_gpu_affinity -------------------------- */
978 |
979 | #ifndef WGL_NV_gpu_affinity
980 | #define WGL_NV_gpu_affinity 1
981 |
982 | #define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
983 | #define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
984 |
985 | DECLARE_HANDLE(HGPUNV);
986 | typedef struct _GPU_DEVICE {
987 | DWORD cb;
988 | CHAR DeviceName[32];
989 | CHAR DeviceString[128];
990 | DWORD Flags;
991 | RECT rcVirtualScreen;
992 | } GPU_DEVICE, *PGPU_DEVICE;
993 |
994 | typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
995 | typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
996 | typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
997 | typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
998 | typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
999 |
1000 | #define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV)
1001 | #define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV)
1002 | #define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV)
1003 | #define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV)
1004 | #define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV)
1005 |
1006 | #define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity)
1007 |
1008 | #endif /* WGL_NV_gpu_affinity */
1009 |
1010 | /* ---------------------- WGL_NV_multisample_coverage ---------------------- */
1011 |
1012 | #ifndef WGL_NV_multisample_coverage
1013 | #define WGL_NV_multisample_coverage 1
1014 |
1015 | #define WGL_COVERAGE_SAMPLES_NV 0x2042
1016 | #define WGL_COLOR_SAMPLES_NV 0x20B9
1017 |
1018 | #define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage)
1019 |
1020 | #endif /* WGL_NV_multisample_coverage */
1021 |
1022 | /* -------------------------- WGL_NV_present_video ------------------------- */
1023 |
1024 | #ifndef WGL_NV_present_video
1025 | #define WGL_NV_present_video 1
1026 |
1027 | #define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
1028 |
1029 | DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
1030 |
1031 | typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList);
1032 | typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList);
1033 | typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue);
1034 |
1035 | #define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV)
1036 | #define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV)
1037 | #define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV)
1038 |
1039 | #define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video)
1040 |
1041 | #endif /* WGL_NV_present_video */
1042 |
1043 | /* ---------------------- WGL_NV_render_depth_texture ---------------------- */
1044 |
1045 | #ifndef WGL_NV_render_depth_texture
1046 | #define WGL_NV_render_depth_texture 1
1047 |
1048 | #define WGL_NO_TEXTURE_ARB 0x2077
1049 | #define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
1050 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
1051 | #define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
1052 | #define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
1053 | #define WGL_DEPTH_COMPONENT_NV 0x20A7
1054 |
1055 | #define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture)
1056 |
1057 | #endif /* WGL_NV_render_depth_texture */
1058 |
1059 | /* -------------------- WGL_NV_render_texture_rectangle -------------------- */
1060 |
1061 | #ifndef WGL_NV_render_texture_rectangle
1062 | #define WGL_NV_render_texture_rectangle 1
1063 |
1064 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
1065 | #define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
1066 | #define WGL_TEXTURE_RECTANGLE_NV 0x20A2
1067 |
1068 | #define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle)
1069 |
1070 | #endif /* WGL_NV_render_texture_rectangle */
1071 |
1072 | /* --------------------------- WGL_NV_swap_group --------------------------- */
1073 |
1074 | #ifndef WGL_NV_swap_group
1075 | #define WGL_NV_swap_group 1
1076 |
1077 | typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
1078 | typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
1079 | typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count);
1080 | typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers);
1081 | typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier);
1082 | typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
1083 |
1084 | #define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV)
1085 | #define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV)
1086 | #define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV)
1087 | #define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV)
1088 | #define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV)
1089 | #define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV)
1090 |
1091 | #define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group)
1092 |
1093 | #endif /* WGL_NV_swap_group */
1094 |
1095 | /* ----------------------- WGL_NV_vertex_array_range ----------------------- */
1096 |
1097 | #ifndef WGL_NV_vertex_array_range
1098 | #define WGL_NV_vertex_array_range 1
1099 |
1100 | typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
1101 | typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
1102 |
1103 | #define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV)
1104 | #define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV)
1105 |
1106 | #define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range)
1107 |
1108 | #endif /* WGL_NV_vertex_array_range */
1109 |
1110 | /* -------------------------- WGL_NV_video_capture ------------------------- */
1111 |
1112 | #ifndef WGL_NV_video_capture
1113 | #define WGL_NV_video_capture 1
1114 |
1115 | #define WGL_UNIQUE_ID_NV 0x20CE
1116 | #define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
1117 |
1118 | DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
1119 |
1120 | typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
1121 | typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList);
1122 | typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
1123 | typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue);
1124 | typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
1125 |
1126 | #define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV)
1127 | #define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV)
1128 | #define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV)
1129 | #define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV)
1130 | #define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV)
1131 |
1132 | #define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture)
1133 |
1134 | #endif /* WGL_NV_video_capture */
1135 |
1136 | /* -------------------------- WGL_NV_video_output -------------------------- */
1137 |
1138 | #ifndef WGL_NV_video_output
1139 | #define WGL_NV_video_output 1
1140 |
1141 | #define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
1142 | #define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
1143 | #define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
1144 | #define WGL_VIDEO_OUT_COLOR_NV 0x20C3
1145 | #define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
1146 | #define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
1147 | #define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
1148 | #define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
1149 | #define WGL_VIDEO_OUT_FRAME 0x20C8
1150 | #define WGL_VIDEO_OUT_FIELD_1 0x20C9
1151 | #define WGL_VIDEO_OUT_FIELD_2 0x20CA
1152 | #define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
1153 | #define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
1154 |
1155 | DECLARE_HANDLE(HPVIDEODEV);
1156 |
1157 | typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
1158 | typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice);
1159 | typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
1160 | typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
1161 | typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
1162 | typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock);
1163 |
1164 | #define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV)
1165 | #define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV)
1166 | #define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV)
1167 | #define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV)
1168 | #define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV)
1169 | #define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV)
1170 |
1171 | #define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output)
1172 |
1173 | #endif /* WGL_NV_video_output */
1174 |
1175 | /* -------------------------- WGL_OML_sync_control ------------------------- */
1176 |
1177 | #ifndef WGL_OML_sync_control
1178 | #define WGL_OML_sync_control 1
1179 |
1180 | typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator);
1181 | typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc);
1182 | typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
1183 | typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
1184 | typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc);
1185 | typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc);
1186 |
1187 | #define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML)
1188 | #define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML)
1189 | #define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML)
1190 | #define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML)
1191 | #define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML)
1192 | #define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML)
1193 |
1194 | #define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control)
1195 |
1196 | #endif /* WGL_OML_sync_control */
1197 |
1198 | /* ------------------------------------------------------------------------- */
1199 |
1200 | #ifdef GLEW_MX
1201 | #define WGLEW_FUN_EXPORT
1202 | #define WGLEW_VAR_EXPORT
1203 | #else
1204 | #define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT
1205 | #define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT
1206 | #endif /* GLEW_MX */
1207 |
1208 | #ifdef GLEW_MX
1209 | struct WGLEWContextStruct
1210 | {
1211 | #endif /* GLEW_MX */
1212 |
1213 | WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL;
1214 |
1215 | WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD;
1216 | WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD;
1217 | WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD;
1218 | WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD;
1219 | WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD;
1220 | WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD;
1221 | WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD;
1222 | WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD;
1223 | WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD;
1224 |
1225 | WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB;
1226 | WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB;
1227 | WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB;
1228 | WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB;
1229 |
1230 | WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB;
1231 |
1232 | WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB;
1233 |
1234 | WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB;
1235 | WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB;
1236 |
1237 | WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB;
1238 | WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB;
1239 | WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB;
1240 | WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB;
1241 | WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB;
1242 |
1243 | WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB;
1244 | WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB;
1245 | WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB;
1246 |
1247 | WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB;
1248 | WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB;
1249 | WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB;
1250 |
1251 | WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT;
1252 | WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT;
1253 | WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT;
1254 | WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT;
1255 |
1256 | WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT;
1257 |
1258 | WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT;
1259 | WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT;
1260 |
1261 | WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT;
1262 | WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT;
1263 | WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT;
1264 | WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT;
1265 | WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT;
1266 |
1267 | WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT;
1268 | WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT;
1269 | WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT;
1270 |
1271 | WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT;
1272 | WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT;
1273 |
1274 | WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D;
1275 | WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D;
1276 |
1277 | WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D;
1278 | WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D;
1279 | WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D;
1280 | WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D;
1281 |
1282 | WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D;
1283 | WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D;
1284 | WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D;
1285 | WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D;
1286 | WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D;
1287 | WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D;
1288 | WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D;
1289 | WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D;
1290 | WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D;
1291 | WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D;
1292 | WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D;
1293 | WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D;
1294 |
1295 | WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D;
1296 | WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D;
1297 | WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D;
1298 | WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D;
1299 |
1300 | WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D;
1301 | WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D;
1302 | WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D;
1303 | WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D;
1304 |
1305 | WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D;
1306 | WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D;
1307 | WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D;
1308 | WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D;
1309 |
1310 | WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV;
1311 | WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV;
1312 | WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV;
1313 | WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV;
1314 | WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV;
1315 | WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV;
1316 | WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV;
1317 | WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV;
1318 |
1319 | WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV;
1320 |
1321 | WGLEW_FUN_EXPORT PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV;
1322 |
1323 | WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV;
1324 | WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV;
1325 | WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV;
1326 | WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV;
1327 | WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV;
1328 |
1329 | WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV;
1330 | WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV;
1331 | WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV;
1332 |
1333 | WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV;
1334 | WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV;
1335 | WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV;
1336 | WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV;
1337 | WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV;
1338 | WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV;
1339 |
1340 | WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV;
1341 | WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV;
1342 |
1343 | WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV;
1344 | WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV;
1345 | WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV;
1346 | WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV;
1347 | WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV;
1348 |
1349 | WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV;
1350 | WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV;
1351 | WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV;
1352 | WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV;
1353 | WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV;
1354 | WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV;
1355 |
1356 | WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML;
1357 | WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML;
1358 | WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML;
1359 | WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML;
1360 | WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML;
1361 | WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML;
1362 | WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample;
1363 | WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control;
1364 | WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association;
1365 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region;
1366 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_context_flush_control;
1367 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context;
1368 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile;
1369 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness;
1370 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string;
1371 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB;
1372 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read;
1373 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample;
1374 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer;
1375 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format;
1376 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float;
1377 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture;
1378 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation;
1379 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation;
1380 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float;
1381 | WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle;
1382 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile;
1383 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile;
1384 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float;
1385 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table;
1386 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string;
1387 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB;
1388 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read;
1389 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample;
1390 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer;
1391 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format;
1392 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float;
1393 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control;
1394 | WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear;
1395 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control;
1396 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma;
1397 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock;
1398 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer;
1399 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock;
1400 | WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage;
1401 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop;
1402 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2;
1403 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image;
1404 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_delay_before_swap;
1405 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer;
1406 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity;
1407 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage;
1408 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video;
1409 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture;
1410 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle;
1411 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group;
1412 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range;
1413 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture;
1414 | WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output;
1415 | WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control;
1416 |
1417 | #ifdef GLEW_MX
1418 | }; /* WGLEWContextStruct */
1419 | #endif /* GLEW_MX */
1420 |
1421 | /* ------------------------------------------------------------------------- */
1422 |
1423 | #ifdef GLEW_MX
1424 |
1425 | typedef struct WGLEWContextStruct WGLEWContext;
1426 | GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx);
1427 | GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name);
1428 |
1429 | #define wglewInit() wglewContextInit(wglewGetContext())
1430 | #define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x)
1431 |
1432 | #define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x))
1433 | #define WGLEW_GET_FUN(x) wglewGetContext()->x
1434 |
1435 | #else /* GLEW_MX */
1436 |
1437 | GLEWAPI GLenum GLEWAPIENTRY wglewInit ();
1438 | GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name);
1439 |
1440 | #define WGLEW_GET_VAR(x) (*(const GLboolean*)&x)
1441 | #define WGLEW_GET_FUN(x) x
1442 |
1443 | #endif /* GLEW_MX */
1444 |
1445 | GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name);
1446 |
1447 | #ifdef __cplusplus
1448 | }
1449 | #endif
1450 |
1451 | #undef GLEWAPI
1452 |
1453 | #endif /* __wglew_h__ */
1454 |
--------------------------------------------------------------------------------
/external/GLEW/lib/Debug/Win32/glew32sd.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPPEngine/4f981624595f994619d67fb8ebbc2618c116e8a4/external/GLEW/lib/Debug/Win32/glew32sd.lib
--------------------------------------------------------------------------------
/external/GLEW/lib/Debug/x64/glew32sd.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPPEngine/4f981624595f994619d67fb8ebbc2618c116e8a4/external/GLEW/lib/Debug/x64/glew32sd.lib
--------------------------------------------------------------------------------
/external/GLEW/lib/Release/Win32/glew32s.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPPEngine/4f981624595f994619d67fb8ebbc2618c116e8a4/external/GLEW/lib/Release/Win32/glew32s.lib
--------------------------------------------------------------------------------
/external/GLEW/lib/Release/x64/glew32s.lib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPPEngine/4f981624595f994619d67fb8ebbc2618c116e8a4/external/GLEW/lib/Release/x64/glew32s.lib
--------------------------------------------------------------------------------