├── DOPPenable.exe ├── DOPPEffectOpenGL ├── DOPPWin32 │ ├── resource.h │ ├── DOPPEngine.rc │ ├── res │ │ ├── AMDIcon.ico │ │ └── DOPPEngine.rc2 │ ├── stdafx.cpp │ ├── data │ │ ├── base.vert │ │ ├── base.frag │ │ ├── colorInv.frag │ │ ├── transform.vert │ │ ├── distort.frag │ │ └── laplace.frag │ ├── targetver.h │ ├── stdafx.h │ ├── GLDOPPColorInvert.h │ ├── GLDOPPEdgeFilter.h │ ├── GLDOPPDistort.h │ ├── GLDOPPRotate.h │ ├── DOPPEngine.h │ ├── DOPPRotationDlg.h │ ├── GLShader.h │ ├── DOPPWin32.vcxproj.filters │ ├── GLDOPPEngine.h │ ├── GLDOPPColorInvert.cpp │ ├── GLDOPPEdgeFilter.cpp │ ├── DOPPRotationDlg.cpp │ ├── DOPPEngine.cpp │ ├── DOPPEngineDlg.h │ ├── GLDOPPDistort.cpp │ ├── GLDOPPRotate.cpp │ ├── GLShader.cpp │ ├── DOPPWin32.vcxproj │ ├── GLDOPPEngine.cpp │ └── DOPPEngineDlg.cpp └── DOPPEffectOpenGL.sln ├── external ├── glew-1.9.0 │ └── lib │ │ └── win32-vc │ │ ├── glew32s.lib │ │ └── glew32sd.lib └── ADL │ ├── adl_sdk.h │ └── adl_defines.h ├── README.md ├── LICENSE.txt └── common ├── os_include.hpp ├── DisplayManager.h ├── GLWindow.hpp ├── GLWindow.cpp └── DisplayManager.cpp /DOPPenable.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPP/HEAD/DOPPenable.exe -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPP/HEAD/DOPPEffectOpenGL/DOPPWin32/resource.h -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/DOPPEngine.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPP/HEAD/DOPPEffectOpenGL/DOPPWin32/DOPPEngine.rc -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/res/AMDIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPP/HEAD/DOPPEffectOpenGL/DOPPWin32/res/AMDIcon.ico -------------------------------------------------------------------------------- /external/glew-1.9.0/lib/win32-vc/glew32s.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPP/HEAD/external/glew-1.9.0/lib/win32-vc/glew32s.lib -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/res/DOPPEngine.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPP/HEAD/DOPPEffectOpenGL/DOPPWin32/res/DOPPEngine.rc2 -------------------------------------------------------------------------------- /external/glew-1.9.0/lib/win32-vc/glew32sd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/DOPP/HEAD/external/glew-1.9.0/lib/win32-vc/glew32sd.lib -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/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 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/data/base.vert: -------------------------------------------------------------------------------- 1 | #version 420 core 2 | 3 | layout(location = 0) in vec4 inVertex; 4 | layout(location = 4) in vec2 inTexCoord; 5 | 6 | out vec2 TexCoord; 7 | 8 | void main( void ) 9 | { 10 | gl_Position = inVertex; 11 | TexCoord = inTexCoord; 12 | } 13 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/data/base.frag: -------------------------------------------------------------------------------- 1 | #version 420 core 2 | 3 | uniform sampler2D baseMap; 4 | 5 | in vec2 TexCoord; 6 | 7 | void main( void ) 8 | { 9 | vec4 texColor = texture2D( baseMap, TexCoord ); 10 | 11 | gl_FragColor = vec4(texColor.r, texColor.g, texColor.b, texColor.a); 12 | } -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/data/colorInv.frag: -------------------------------------------------------------------------------- 1 | #version 420 core 2 | 3 | uniform sampler2D baseMap; 4 | 5 | in vec2 TexCoord; 6 | 7 | void main( void ) 8 | { 9 | vec4 texColor = texture2D( baseMap, TexCoord ); 10 | 11 | gl_FragColor = vec4(1.0) - vec4(texColor.r, texColor.g, texColor.b, 0.0); 12 | } -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/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 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/data/transform.vert: -------------------------------------------------------------------------------- 1 | 2 | #version 420 core 3 | 4 | layout(location = 0) in vec4 inVertex; 5 | layout(location = 4) in vec2 inTexCoord; 6 | 7 | layout(shared, binding = 0) uniform FrameData 8 | { 9 | mat4 ModelViewMat; 10 | mat4 ProjectionMat; 11 | }; 12 | 13 | out vec2 TexCoord; 14 | 15 | 16 | void main() 17 | { 18 | TexCoord = inTexCoord; 19 | 20 | gl_Position = ProjectionMat * ModelViewMat * inVertex; 21 | } -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/data/distort.frag: -------------------------------------------------------------------------------- 1 | #version 420 core 2 | 3 | uniform float fTime; 4 | uniform sampler2D baseMap; 5 | 6 | in 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 | } -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPEffectOpenGL.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DOPPWin32", "DOPPWin32\DOPPWin32.vcxproj", "{A85BC28A-4DCF-4018-A076-B0D6B253AF9C}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {A85BC28A-4DCF-4018-A076-B0D6B253AF9C}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {A85BC28A-4DCF-4018-A076-B0D6B253AF9C}.Debug|Win32.Build.0 = Debug|Win32 14 | {A85BC28A-4DCF-4018-A076-B0D6B253AF9C}.Release|Win32.ActiveCfg = Release|Win32 15 | {A85BC28A-4DCF-4018-A076-B0D6B253AF9C}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/data/laplace.frag: -------------------------------------------------------------------------------- 1 | #version 420 core 2 | 3 | uniform sampler2D baseMap; 4 | 5 | in 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 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ============================== 3 | == == 4 | == SDK of AMD Firepro DOPP == 5 | == == 6 | ============================== 7 | 8 | Display Output Post-Processing (DOPP) is an AMD OpenGL extension 9 | that lets users of AMD FirePro workstation cards grab the desktop directly 10 | as a texture and manipulate it in an almost infinite number of ways 11 | before it is output to a display system. 12 | 13 | This SDK contains: 14 | - an open source DOPP sample. 15 | - the DOPPenable.exe tool. 16 | 17 | 18 | DOPPenable.exe 19 | --------------- 20 | This tool enables DOPP on your system. You need to to that if you want to use the DOPP feature. 21 | Before using DOPP, please start this tool and click on "Enable DOPP". 22 | Then restart your system. 23 | 24 | 25 | DOPPEffectOpenGL sample 26 | --------------------------- 27 | Show you how you can apply several visual effects on your desktop with DOPP. 28 | open DOPPEffectOpenGL.sln with Visual Studio 2010. 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /external/ADL/adl_sdk.h: -------------------------------------------------------------------------------- 1 | /// 2 | /// Copyright (c) 2008 - 2009 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 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 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. -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/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 | -------------------------------------------------------------------------------- /common/os_include.hpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | 50 | 51 | #pragma once 52 | 53 | #if defined( WIN32 ) 54 | #include 55 | #include 56 | 57 | typedef HDC DC; 58 | typedef HWND WINDOW; 59 | typedef HGLRC GLCTX; 60 | 61 | #endif 62 | 63 | 64 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLDOPPColorInvert.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | #pragma once 50 | 51 | #include "GLDOPPEngine.h" 52 | 53 | 54 | class GLDOPPColorInvert : public GLDOPPEngine 55 | { 56 | public: 57 | GLDOPPColorInvert(); 58 | ~GLDOPPColorInvert(); 59 | 60 | virtual bool initEffect() override; 61 | virtual void updateTexture() override; 62 | 63 | private: 64 | 65 | GLShader* m_pProgram; 66 | GLuint m_uiBasmapLoc; 67 | }; 68 | 69 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLDOPPEdgeFilter.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | #pragma once 50 | 51 | #include "GLDOPPEngine.h" 52 | 53 | 54 | 55 | class GLDOPPEdgeFilter : public GLDOPPEngine 56 | { 57 | public: 58 | GLDOPPEdgeFilter(); 59 | ~GLDOPPEdgeFilter(); 60 | 61 | virtual bool initEffect() override; 62 | virtual void updateTexture() override; 63 | 64 | private: 65 | 66 | GLShader* m_pProgram; 67 | GLuint m_uiBasmapLoc; 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLDOPPDistort.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | #pragma once 50 | 51 | #include "GLDOPPEngine.h" 52 | 53 | 54 | class GLDOPPDistort : public GLDOPPEngine 55 | { 56 | public: 57 | GLDOPPDistort(); 58 | ~GLDOPPDistort(); 59 | 60 | virtual bool initEffect() override; 61 | virtual void updateTexture() override; 62 | 63 | private: 64 | 65 | GLShader* m_pProgram; 66 | GLuint m_uiBasmapLoc; 67 | GLuint m_uiTimerLoc; 68 | 69 | long long m_lStartCount; 70 | long long m_lFreq; 71 | }; 72 | 73 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLDOPPRotate.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | #pragma once 50 | 51 | #include "GLDOPPEngine.h" 52 | 53 | 54 | class GLDOPPRotate : public GLDOPPEngine 55 | { 56 | public: 57 | 58 | GLDOPPRotate(void); 59 | ~GLDOPPRotate(void); 60 | 61 | virtual bool initEffect() override; 62 | virtual void updateTexture() override; 63 | 64 | void setRotation(float a); 65 | 66 | private: 67 | 68 | GLShader* m_pProgram; 69 | GLuint m_uiBasmapLoc; 70 | GLuint m_uiTransform; 71 | 72 | float m_pModelViewMat[16]; 73 | float m_pProjectionMat[16]; 74 | }; 75 | 76 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/DOPPEngine.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | // DOPPEngine.h : main header file for the PROJECT_NAME application 50 | // 51 | 52 | #pragma once 53 | 54 | #ifndef __AFXWIN_H__ 55 | #error "include 'stdafx.h' before including this file for PCH" 56 | #endif 57 | 58 | #include "resource.h" // main symbols 59 | 60 | 61 | // CDOPPEngineApp: 62 | // See DOPPEngine.cpp for the implementation of this class 63 | // 64 | 65 | class CDOPPEngineApp : public CWinApp 66 | { 67 | public: 68 | CDOPPEngineApp(); 69 | 70 | // Overrides 71 | public: 72 | virtual BOOL InitInstance(); 73 | 74 | // Implementation 75 | 76 | DECLARE_MESSAGE_MAP() 77 | }; 78 | 79 | extern CDOPPEngineApp theApp; -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/DOPPRotationDlg.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | #pragma once 50 | 51 | 52 | // DOPPRotationDlg dialog 53 | 54 | class DOPPRotationDlg : public CDialogEx 55 | { 56 | DECLARE_DYNAMIC(DOPPRotationDlg) 57 | 58 | public: 59 | DOPPRotationDlg(CWnd* pParent = NULL); // standard constructor 60 | virtual ~DOPPRotationDlg(); 61 | 62 | // Dialog Data 63 | enum { IDD = IDD_DIALOG_ANGLE }; 64 | 65 | unsigned int getAngle() { return m_uiAngle; }; 66 | 67 | protected: 68 | 69 | virtual BOOL OnInitDialog(); 70 | 71 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 72 | 73 | DECLARE_MESSAGE_MAP() 74 | 75 | private: 76 | 77 | CSliderCtrl* m_pSlider; 78 | CEdit* m_pSliderValue; 79 | 80 | unsigned int m_uiAngle; 81 | 82 | public: 83 | afx_msg void OnNMCustomdrawSliderAngle(NMHDR *pNMHDR, LRESULT *pResult); 84 | afx_msg void OnBnClickedOk(); 85 | afx_msg void OnBnClickedCancle(); 86 | afx_msg void OnStnClickedStaticValue(); 87 | }; 88 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLShader.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | #pragma once 50 | #include 51 | 52 | class GLShader 53 | { 54 | public: 55 | 56 | GLShader(); 57 | virtual ~GLShader(); 58 | 59 | bool createVertexShaderFromFile(const char* pFileName); 60 | bool createFragmentShaderFromFile(const char* pFileName); 61 | 62 | bool createVertexShaderFromString(const char* pSource); 63 | bool createFragmentShaderFromString(const char* pSource); 64 | 65 | bool buildProgram(); 66 | 67 | void bind() { glUseProgram(m_uiProgram); }; 68 | void unbind() { glUseProgram(0); }; 69 | 70 | unsigned int getProgram() { return m_uiProgram; }; 71 | const char* getErrorMessage() { return m_strErrorMessage.c_str(); }; 72 | 73 | private: 74 | 75 | bool readShaderSource(const char* pFileName, std::string &strSource); 76 | bool createShader(const char* pSource, unsigned int uiType); 77 | 78 | unsigned int m_uiVertexShader; 79 | unsigned int m_uiFragmentShader; 80 | unsigned int m_uiProgram; 81 | 82 | std::string m_strErrorMessage; 83 | 84 | }; -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/DOPPWin32.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 | {23c898f8-879b-4de4-ac9a-dfbbaed62377} 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | Source Files 38 | 39 | 40 | Source Files 41 | 42 | 43 | Source Files 44 | 45 | 46 | common 47 | 48 | 49 | common 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 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 | common 91 | 92 | 93 | common 94 | 95 | 96 | common 97 | 98 | 99 | Header Files 100 | 101 | 102 | Header Files 103 | 104 | 105 | 106 | 107 | Resource Files 108 | 109 | 110 | 111 | 112 | Resource Files 113 | 114 | 115 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLDOPPEngine.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | #pragma once 50 | 51 | #include 52 | 53 | 54 | class GLShader; 55 | 56 | 57 | class GLDOPPEngine 58 | { 59 | public: 60 | 61 | GLDOPPEngine(); 62 | virtual ~GLDOPPEngine(); 63 | 64 | bool initDOPP(unsigned int uiDesktop = 1, bool bPresent = true); 65 | 66 | virtual bool initEffect(); 67 | virtual void updateTexture(); 68 | 69 | void processDesktop(); 70 | 71 | GLuint getPresentTexture() { return m_uiPresentTexture; }; 72 | GLuint getPresentBuffer() { return m_uiFBO; }; 73 | GLuint getDesktopTexture() { return m_uiDesktopTexture; }; 74 | 75 | unsigned int getDesktopWidth() { return m_uiDesktopWidth; }; 76 | unsigned int getDesktopHeight() { return m_uiDesktopHeight; }; 77 | 78 | protected: 79 | 80 | void createQuad(); 81 | 82 | GLuint m_uiDesktopTexture; 83 | GLuint m_uiPresentTexture; 84 | 85 | GLuint m_uiVertexArray; 86 | 87 | GLShader* m_pShader; 88 | GLuint m_uiBaseMap; 89 | 90 | unsigned int m_uiDesktopWidth; 91 | unsigned int m_uiDesktopHeight; 92 | 93 | private: 94 | 95 | bool setupDOPPExtension(); 96 | 97 | GLuint m_uiVertexBuffer; 98 | 99 | GLuint m_uiFBO; 100 | 101 | bool m_bStartPostProcessing; 102 | bool m_bDoPresent; 103 | }; 104 | 105 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLDOPPColorInvert.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | #include "StdAfx.h" 50 | #include 51 | 52 | 53 | #include "GLShader.h" 54 | #include "GLDOPPColorInvert.h" 55 | 56 | 57 | 58 | 59 | GLDOPPColorInvert::GLDOPPColorInvert() : GLDOPPEngine(), 60 | m_pProgram(NULL), m_uiBasmapLoc(0) 61 | { 62 | } 63 | 64 | 65 | GLDOPPColorInvert::~GLDOPPColorInvert(void) 66 | { 67 | if (m_pProgram) 68 | { 69 | delete m_pProgram; m_pProgram = NULL; 70 | } 71 | } 72 | 73 | 74 | bool GLDOPPColorInvert::initEffect() 75 | { 76 | if (m_pProgram) 77 | { 78 | delete m_pProgram; m_pProgram = NULL; 79 | } 80 | 81 | m_pProgram = new GLShader; 82 | 83 | std::string const vertShaderSource(std::string("./data/base.vert")); 84 | std::string const fragShaderSource(std::string("./data/colorInv.frag")); 85 | if ((!m_pProgram->createVertexShaderFromFile(vertShaderSource.c_str())) || (!m_pProgram->createFragmentShaderFromFile(fragShaderSource.c_str()))) 86 | { 87 | return false; 88 | } 89 | 90 | if (!m_pProgram->buildProgram()) 91 | { 92 | return false; 93 | } 94 | 95 | m_uiBasmapLoc = glGetUniformLocation(m_pProgram->getProgram(), "baseMap"); 96 | 97 | createQuad(); 98 | 99 | return true; 100 | } 101 | 102 | 103 | void GLDOPPColorInvert::updateTexture() 104 | { 105 | m_pProgram->bind(); 106 | 107 | glActiveTexture(GL_TEXTURE1); 108 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture); 109 | 110 | glUniform1i(m_uiBasmapLoc, 1); 111 | 112 | glBindVertexArray(m_uiVertexArray); 113 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 114 | glBindVertexArray(0); 115 | 116 | m_pProgram->unbind(); 117 | } 118 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLDOPPEdgeFilter.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | #include "StdAfx.h" 50 | #include 51 | 52 | 53 | #include "GLShader.h" 54 | #include "GLDOPPEdgeFilter.h" 55 | 56 | 57 | 58 | 59 | GLDOPPEdgeFilter::GLDOPPEdgeFilter() : GLDOPPEngine(), 60 | m_pProgram(NULL), m_uiBasmapLoc(0) 61 | { 62 | } 63 | 64 | 65 | GLDOPPEdgeFilter::~GLDOPPEdgeFilter(void) 66 | { 67 | if (m_pProgram) 68 | { 69 | delete m_pProgram; m_pProgram = NULL; 70 | } 71 | } 72 | 73 | 74 | 75 | bool GLDOPPEdgeFilter::initEffect() 76 | { 77 | if (m_pProgram) 78 | { 79 | delete m_pProgram; m_pProgram = NULL; 80 | } 81 | 82 | m_pProgram = new GLShader; 83 | 84 | std::string const vertShaderSource(std::string("./data/base.vert")); 85 | std::string const fragShaderSource(std::string("./data/laplace.frag")); 86 | 87 | if ((!m_pProgram->createVertexShaderFromFile(vertShaderSource.c_str())) || (!m_pProgram->createFragmentShaderFromFile(fragShaderSource.c_str()))) 88 | { 89 | return false; 90 | } 91 | 92 | if (!m_pProgram->buildProgram()) 93 | { 94 | return false; 95 | } 96 | 97 | m_uiBasmapLoc = glGetUniformLocation(m_pProgram->getProgram(), "baseMap"); 98 | 99 | createQuad(); 100 | 101 | return true; 102 | } 103 | 104 | 105 | void GLDOPPEdgeFilter::updateTexture() 106 | { 107 | m_pProgram->bind(); 108 | 109 | glActiveTexture(GL_TEXTURE1); 110 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture); 111 | 112 | glUniform1i(m_uiBasmapLoc, 1); 113 | 114 | glBindVertexArray(m_uiVertexArray); 115 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 116 | glBindVertexArray(0); 117 | 118 | m_pProgram->unbind(); 119 | } 120 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/DOPPRotationDlg.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | // DOPPRotationDlg.cpp : implementation file 50 | // 51 | 52 | #include "stdafx.h" 53 | #include "DOPPEngine.h" 54 | #include "DOPPRotationDlg.h" 55 | #include "afxdialogex.h" 56 | 57 | 58 | 59 | 60 | IMPLEMENT_DYNAMIC(DOPPRotationDlg, CDialogEx) 61 | 62 | DOPPRotationDlg::DOPPRotationDlg(CWnd* pParent) 63 | : CDialogEx(DOPPRotationDlg::IDD, pParent) 64 | { 65 | m_pSlider = NULL; 66 | m_pSliderValue = NULL; 67 | 68 | m_uiAngle = 0; 69 | } 70 | 71 | DOPPRotationDlg::~DOPPRotationDlg() 72 | { 73 | } 74 | 75 | void DOPPRotationDlg::DoDataExchange(CDataExchange* pDX) 76 | { 77 | CDialogEx::DoDataExchange(pDX); 78 | } 79 | 80 | 81 | BEGIN_MESSAGE_MAP(DOPPRotationDlg, CDialogEx) 82 | ON_NOTIFY(NM_CUSTOMDRAW, IDC_SLIDER_ANGLE, &DOPPRotationDlg::OnNMCustomdrawSliderAngle) 83 | ON_BN_CLICKED(IDOK, &DOPPRotationDlg::OnBnClickedOk) 84 | ON_BN_CLICKED(IDCANCLE, &DOPPRotationDlg::OnBnClickedCancle) 85 | END_MESSAGE_MAP() 86 | 87 | 88 | 89 | 90 | void DOPPRotationDlg::OnNMCustomdrawSliderAngle(NMHDR *pNMHDR, LRESULT *pResult) 91 | { 92 | m_uiAngle = m_pSlider->GetPos(); 93 | 94 | char buf[8]; 95 | 96 | sprintf_s(buf," %d", m_uiAngle); 97 | 98 | m_pSliderValue->SetWindowTextW(CA2CT(buf)); 99 | } 100 | 101 | 102 | 103 | BOOL DOPPRotationDlg::OnInitDialog() 104 | { 105 | m_pSlider = static_cast(GetDlgItem(IDC_SLIDER_ANGLE)); 106 | 107 | m_pSliderValue = static_cast(GetDlgItem(IDC_EDIT_VALUE)); 108 | 109 | if (!m_pSlider || !m_pSliderValue) 110 | { 111 | return false; 112 | } 113 | 114 | m_pSlider->SetRange(0, 360, false); 115 | 116 | return true; 117 | } 118 | 119 | 120 | void DOPPRotationDlg::OnBnClickedOk() 121 | { 122 | CDialogEx::OnOK(); 123 | } 124 | 125 | 126 | void DOPPRotationDlg::OnBnClickedCancle() 127 | { 128 | CDialogEx::OnCancel(); 129 | } 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /common/DisplayManager.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | 50 | #pragma once 51 | 52 | #include 53 | 54 | struct DisplayData; 55 | 56 | class DisplayManager 57 | { 58 | public: 59 | 60 | DisplayManager(); 61 | ~DisplayManager(); 62 | 63 | // Enumerates the active desktops.This functions needs to be called before any other method of this class 64 | // The displays are stored in the order in which they are enumerated. An index will be assigned to each display. 65 | // The indexing starts at 0. 66 | // return: The number of mapped displays. 67 | unsigned int enumDisplays(); 68 | 69 | // returns the number of GPUs in the system 70 | unsigned int getNumGPUs(); 71 | 72 | // Returns the number of mapped displays. 73 | unsigned int getNumDisplays(); 74 | 75 | // returns the number of displays mapped on GPU uiGPU 76 | unsigned int getNumDisplaysOnGPU(unsigned int uiGPU); 77 | 78 | // returns the DisplayID of n-th Display on GPU uiGPU 79 | // n=0 will return the first display on GPU uiGPU if available 80 | // n=1 will return the second display on GPU uiGPU if available ... 81 | unsigned int getDisplayOnGPU(unsigned int uiGPU, unsigned int n=0); 82 | 83 | // Returns the display name of display uiDisplay. 84 | const char* getDisplayName(unsigned int uiDisplay); 85 | 86 | // Returns the GPU ID of display uiDisplay. 87 | unsigned int getGpuId(unsigned int uiDisplay); 88 | 89 | // Returns the origin of display uiDisplay. 90 | bool getOrigin(unsigned int uiDisplay, int &uiOriginX, int &uiOriginY); 91 | 92 | // Returns the size of display uiDisplay. 93 | bool getSize(unsigned int uiDisplay, unsigned int &uiWidth, unsigned int &uiHeight); 94 | 95 | private: 96 | 97 | bool setupADL(); 98 | void deleteDisplays(); 99 | 100 | unsigned int m_uiNumGPU; 101 | 102 | std::vector m_Displays; 103 | }; -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/DOPPEngine.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | 50 | // DOPPEngine.cpp : Defines the class behaviors for the application. 51 | // 52 | 53 | #include "stdafx.h" 54 | #include "DOPPEngine.h" 55 | #include "DOPPEngineDlg.h" 56 | 57 | #ifdef _DEBUG 58 | #define new DEBUG_NEW 59 | #endif 60 | 61 | 62 | // CDOPPEngineApp 63 | 64 | BEGIN_MESSAGE_MAP(CDOPPEngineApp, CWinApp) 65 | ON_COMMAND(ID_HELP, &CWinApp::OnHelp) 66 | END_MESSAGE_MAP() 67 | 68 | 69 | // CDOPPEngineApp construction 70 | 71 | CDOPPEngineApp::CDOPPEngineApp() 72 | { 73 | // support Restart Manager 74 | m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART; 75 | 76 | } 77 | 78 | 79 | // The one and only CDOPPEngineApp object 80 | 81 | CDOPPEngineApp theApp; 82 | 83 | 84 | // CDOPPEngineApp initialization 85 | 86 | BOOL CDOPPEngineApp::InitInstance() 87 | { 88 | // InitCommonControlsEx() is required on Windows XP if an application 89 | // manifest specifies use of ComCtl32.dll version 6 or later to enable 90 | // visual styles. Otherwise, any window creation will fail. 91 | INITCOMMONCONTROLSEX InitCtrls; 92 | InitCtrls.dwSize = sizeof(InitCtrls); 93 | // Set this to include all the common control classes you want to use 94 | // in your application. 95 | InitCtrls.dwICC = ICC_WIN95_CLASSES; 96 | InitCommonControlsEx(&InitCtrls); 97 | 98 | CWinApp::InitInstance(); 99 | 100 | 101 | // Create the shell manager, in case the dialog contains 102 | // any shell tree view or shell list view controls. 103 | CShellManager *pShellManager = new CShellManager; 104 | 105 | // Standard initialization 106 | SetRegistryKey(_T("AMD_DOPP_SDK_DOPPEffectOpenGL")); 107 | 108 | CDOPPEngineDlg dlg; 109 | m_pMainWnd = &dlg; 110 | INT_PTR nResponse = dlg.DoModal(); 111 | 112 | // Delete the shell manager created above. 113 | if (pShellManager != NULL) 114 | { 115 | delete pShellManager; 116 | pShellManager=NULL; 117 | } 118 | 119 | // Since the dialog has been closed, return FALSE so that we exit the 120 | // application, rather than start the application's message pump. 121 | return FALSE; 122 | } 123 | 124 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/DOPPEngineDlg.h: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | 50 | 51 | // DOPPEngineDlg.h : header file 52 | // 53 | 54 | #pragma once 55 | 56 | 57 | class DisplayManager; 58 | class DOPPRotationDlg; 59 | 60 | 61 | // CDOPPEngineDlg dialog 62 | class CDOPPEngineDlg : public CDialogEx 63 | { 64 | // Construction 65 | public: 66 | CDOPPEngineDlg(CWnd* pParent = NULL); // standard constructor 67 | ~CDOPPEngineDlg(); 68 | 69 | // Dialog Data 70 | enum { IDD = IDD_DOPPENGINE_DIALOG }; 71 | 72 | protected: 73 | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 74 | 75 | 76 | // Implementation 77 | protected: 78 | HICON m_hIcon; 79 | 80 | // Generated message map functions 81 | virtual BOOL OnInitDialog(); 82 | afx_msg void OnPaint(); 83 | afx_msg void OnSize(UINT nType, int cx, int cy); 84 | afx_msg HCURSOR OnQueryDragIcon(); 85 | afx_msg void OnStart(); 86 | afx_msg void OnStop(); 87 | afx_msg void OnExit(); 88 | 89 | DECLARE_MESSAGE_MAP() 90 | 91 | private: 92 | 93 | enum EffectId { NO_EFFECT, COLOR_INVERT, EDGE_FILTER, DISTORT_EFFECT, ROTATE_DESKTOP }; 94 | 95 | bool createGLWindow(); 96 | void showWindow(); 97 | void deleteWindow(); 98 | 99 | static DWORD threadFunction(void* pData); 100 | DWORD threadLoop(); 101 | 102 | DWORD m_dwThreadId; 103 | bool m_bEngineRunning; 104 | HANDLE m_hEngineThread; 105 | 106 | HWND m_hWnd; 107 | HDC m_hDC; 108 | HGLRC m_hCtx; 109 | 110 | unsigned int m_uiEffectSelection; 111 | unsigned int m_uiDesktopSelection; 112 | unsigned int m_uiRotationAngle; 113 | 114 | CComboBox* m_pEffectComboBox; 115 | CComboBox* m_pDesktopComboBox; 116 | CButton* m_pShowWinCheckBox; 117 | 118 | DisplayManager* m_pDisplayManager; 119 | 120 | DOPPRotationDlg* m_pRotationDlg; 121 | 122 | public: 123 | afx_msg void OnBnClickedCheckWindow(); 124 | }; 125 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLDOPPDistort.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | #include "StdAfx.h" 50 | #include 51 | 52 | 53 | #include "GLShader.h" 54 | #include "GLDOPPDistort.h" 55 | 56 | 57 | 58 | 59 | GLDOPPDistort::GLDOPPDistort(void) : GLDOPPEngine(), 60 | m_pProgram(NULL), m_uiBasmapLoc(0), m_uiTimerLoc(0), m_lStartCount(0) 61 | { 62 | QueryPerformanceFrequency((LARGE_INTEGER*)&m_lFreq); 63 | } 64 | 65 | 66 | GLDOPPDistort::~GLDOPPDistort(void) 67 | { 68 | if (m_pProgram) 69 | { 70 | delete m_pProgram; m_pProgram = NULL; 71 | } 72 | } 73 | 74 | 75 | 76 | bool GLDOPPDistort::initEffect() 77 | { 78 | if (m_pProgram) 79 | { 80 | delete m_pProgram; m_pProgram = NULL; 81 | } 82 | 83 | m_pProgram = new GLShader; 84 | 85 | std::string const vertShaderSource(std::string("./data/base.vert")); 86 | std::string const fragShaderSource(std::string("./data/distort.frag")); 87 | if ((!m_pProgram->createVertexShaderFromFile(vertShaderSource.c_str())) || (!m_pProgram->createFragmentShaderFromFile(fragShaderSource.c_str()))) 88 | { 89 | return false; 90 | } 91 | 92 | if (!m_pProgram->buildProgram()) 93 | { 94 | return false; 95 | } 96 | 97 | m_uiBasmapLoc = glGetUniformLocation(m_pProgram->getProgram(), "baseMap"); 98 | m_uiTimerLoc = glGetUniformLocation(m_pProgram->getProgram(), "fTime"); 99 | 100 | createQuad(); 101 | 102 | QueryPerformanceCounter((LARGE_INTEGER*) &m_lStartCount); 103 | 104 | return true; 105 | } 106 | 107 | 108 | void GLDOPPDistort::updateTexture() 109 | { 110 | long long lCounter; 111 | float fElapsed; 112 | 113 | QueryPerformanceCounter((LARGE_INTEGER*) &lCounter); 114 | 115 | long long lDelta = lCounter - m_lStartCount; 116 | 117 | fElapsed = ((float)lDelta/(float)m_lFreq); 118 | 119 | m_pProgram->bind(); 120 | 121 | glActiveTexture(GL_TEXTURE1); 122 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture); 123 | 124 | glUniform1i(m_uiBasmapLoc, 1); 125 | glUniform1f(m_uiTimerLoc, fElapsed); 126 | 127 | glBindVertexArray(m_uiVertexArray); 128 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 129 | glBindVertexArray(0); 130 | 131 | m_pProgram->unbind(); 132 | } 133 | -------------------------------------------------------------------------------- /common/GLWindow.hpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | 50 | 51 | #pragma once 52 | 53 | #include "os_include.hpp" 54 | 55 | //create GL4.2 context 56 | #define SAMPLE_MAJOR_VERSION 4 57 | #define SAMPLE_MINOR_VERSION 2 58 | 59 | #include 60 | #include 61 | 62 | 63 | 64 | 65 | 66 | class GLWindow 67 | { 68 | public: 69 | GLWindow(const char* strWinName, const char *strClsaaName); 70 | ~GLWindow(); 71 | 72 | 73 | // create a window but does not open it 74 | bool create(unsigned int uiWidth, unsigned int uiHeight, bool FullScreen, bool Stereo, bool Need10Bits, bool bDecoration = true); 75 | void destroy(); 76 | 77 | // creates an OpenGL context for this window 78 | bool createContext(int NBSamples); 79 | void deleteContext(); 80 | 81 | // Opens window 82 | void open(); 83 | 84 | // stores the new window size 85 | void resize(unsigned int uiWidth, unsigned int uiHeight); 86 | 87 | void makeCurrent(); 88 | void swapBuffers(); 89 | 90 | DC getDC() { return m_hDC; }; 91 | WINDOW getWnd() { return m_hWnd;}; 92 | 93 | unsigned int getWidth() { return m_uiWidth; }; 94 | unsigned int getHeight() { return m_uiHeight; }; 95 | 96 | //mouse management 97 | void StartCaptureMouse() { SetCapture(m_hWnd); } 98 | void StopCaptureMouse() { ReleaseCapture(); } 99 | 100 | int GetAdvancedPF( int NBSamples); 101 | bool SetSimplePF( bool Need10Bits, bool NeedStereo); 102 | bool WindowCreation(unsigned int uiWidth, unsigned int uiHeight, bool FullScreen, bool bDecoration = true); 103 | bool IsTempWindow(); 104 | 105 | private: 106 | 107 | DC m_hDC; 108 | GLCTX m_hGLRC; 109 | WINDOW m_hWnd; 110 | int tempWindow; 111 | 112 | unsigned int m_uiWidth; 113 | unsigned int m_uiHeight; 114 | unsigned int m_uiPosX; 115 | unsigned int m_uiPosY; 116 | 117 | bool m_bFullScreen; 118 | 119 | 120 | std::string m_strWinName; 121 | std::string m_strClassName; 122 | PIXELFORMATDESCRIPTOR pfd; 123 | }; 124 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLDOPPRotate.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | 50 | #include "StdAfx.h" 51 | 52 | #define _USE_MATH_DEFINES 53 | 54 | #include 55 | 56 | #include 57 | 58 | #include "GLShader.h" 59 | #include "GLDOPPRotate.h" 60 | 61 | 62 | 63 | GLDOPPRotate::GLDOPPRotate() : GLDOPPEngine(), 64 | m_pProgram(NULL), m_uiBasmapLoc(0) 65 | { 66 | // Init model view 67 | memset(m_pModelViewMat, 0, 16 * sizeof(float)); 68 | 69 | m_pModelViewMat[0] = 1.0f; // [0][0] 70 | m_pModelViewMat[5] = 1.0f; // [1][1] 71 | m_pModelViewMat[10] = 1.0f; // [1][1] 72 | m_pModelViewMat[15] = 1.0f; // [1][1] 73 | 74 | // Init ortho projection matrix as identity 75 | memset(m_pProjectionMat, 0, 16 * sizeof(float)); 76 | 77 | m_pProjectionMat[0] = 1.0f; 78 | m_pProjectionMat[5] = 1.0f; 79 | m_pProjectionMat[10] = 1.0f; 80 | m_pProjectionMat[15] = 1.0f; 81 | } 82 | 83 | 84 | GLDOPPRotate::~GLDOPPRotate(void) 85 | { 86 | if (m_pProgram) 87 | { 88 | delete m_pProgram; m_pProgram = NULL; 89 | } 90 | 91 | if (m_uiTransform) 92 | { 93 | glDeleteBuffers(1, &m_uiTransform); 94 | } 95 | } 96 | 97 | 98 | 99 | bool GLDOPPRotate::initEffect() 100 | { 101 | if (m_pProgram) 102 | { 103 | delete m_pProgram; m_pProgram = NULL; 104 | } 105 | 106 | m_pProgram = new GLShader; 107 | 108 | std::string const vertShaderSource(std::string("./data/transform.vert")); 109 | std::string const fragShaderSource(std::string("./data/base.frag")); 110 | if ((!m_pProgram->createVertexShaderFromFile(vertShaderSource.c_str())) || (!m_pProgram->createFragmentShaderFromFile(fragShaderSource.c_str()))) 111 | { 112 | return false; 113 | } 114 | 115 | if (!m_pProgram->buildProgram()) 116 | { 117 | return false; 118 | } 119 | 120 | m_uiBasmapLoc = glGetUniformLocation(m_pProgram->getProgram(), "baseMap"); 121 | 122 | // create UBO to pass transformation matrix 123 | glGenBuffers(1, &m_uiTransform); 124 | 125 | glBindBuffer(GL_UNIFORM_BUFFER, m_uiTransform); 126 | 127 | glBufferData(GL_UNIFORM_BUFFER, 32 * sizeof(float), m_pModelViewMat, GL_STATIC_DRAW); 128 | 129 | glBufferSubData(GL_UNIFORM_BUFFER, 16 * sizeof(float), 16 * sizeof(float), m_pProjectionMat); 130 | 131 | glBindBuffer(GL_UNIFORM_BUFFER, 0); 132 | 133 | createQuad(); 134 | 135 | return true; 136 | } 137 | 138 | 139 | void GLDOPPRotate::setRotation(float a) 140 | { 141 | float r = ((float)M_PI * a) / 180.0f; 142 | 143 | float ar = (float)m_uiDesktopWidth / (float)m_uiDesktopHeight; 144 | 145 | glBindBuffer(GL_UNIFORM_BUFFER, m_uiTransform); 146 | 147 | float* pMat = (float*)glMapBufferRange(GL_UNIFORM_BUFFER, 0, 32 * sizeof(float), GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT); 148 | 149 | if (pMat) 150 | { 151 | // Build rotation matrix to rotate quad around z axis and scale y to 152 | // have a quad that matched the AR of the desktop texture 153 | pMat[0] = cosf(r); 154 | pMat[1] = -sinf(r) ; 155 | 156 | pMat[4] = sinf(r) / ar; 157 | pMat[5] = cosf(r) / ar; 158 | 159 | // Build otho projection matrix (glOrtho(-1.0f, 1.0f, -1.0f/ar, 1.0f/ar, -1.0f, 1.0f)) 160 | // Only Orth[1][1] need to be updated. The ortho frustum needs to match the AR of the desktop 161 | pMat[21] = ar; 162 | } 163 | 164 | glUnmapBuffer(GL_UNIFORM_BUFFER); 165 | 166 | glBindBuffer(GL_UNIFORM_BUFFER, 0); 167 | } 168 | 169 | 170 | void GLDOPPRotate::updateTexture() 171 | { 172 | glBindBufferBase(GL_UNIFORM_BUFFER, 0, m_uiTransform); 173 | 174 | m_pProgram->bind(); 175 | 176 | glActiveTexture(GL_TEXTURE1); 177 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture); 178 | 179 | glUniform1i(m_uiBasmapLoc, 1); 180 | 181 | glBindVertexArray(m_uiVertexArray); 182 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 183 | glBindVertexArray(0); 184 | 185 | m_pProgram->unbind(); 186 | } 187 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLShader.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | 50 | #include 51 | #include 52 | 53 | #include "GLShader.h" 54 | 55 | using namespace std; 56 | 57 | 58 | GLShader::GLShader() : m_uiVertexShader(0), m_uiFragmentShader(0), m_uiProgram(0) 59 | { 60 | m_strErrorMessage.clear(); 61 | } 62 | 63 | 64 | GLShader::~GLShader() 65 | { 66 | glUseProgram(0); 67 | 68 | glDeleteShader(m_uiVertexShader); 69 | glDeleteShader(m_uiFragmentShader); 70 | 71 | glDeleteProgram(m_uiProgram); 72 | } 73 | 74 | 75 | bool GLShader::createVertexShaderFromFile(const char* pFileName) 76 | { 77 | string strSource; 78 | 79 | if (!readShaderSource(pFileName, strSource)) 80 | { 81 | return false; 82 | } 83 | 84 | const char* pSource = strSource.c_str(); 85 | 86 | if (!createShader(pSource, GL_VERTEX_SHADER)) 87 | { 88 | return false; 89 | } 90 | 91 | return true; 92 | } 93 | 94 | 95 | bool GLShader::createFragmentShaderFromFile(const char* pFileName) 96 | { 97 | string strSource; 98 | 99 | if (!readShaderSource(pFileName, strSource)) 100 | { 101 | return false; 102 | } 103 | 104 | const char* pSource = strSource.c_str(); 105 | 106 | if (!createShader(pSource, GL_FRAGMENT_SHADER)) 107 | { 108 | return false; 109 | } 110 | 111 | return true; 112 | } 113 | 114 | 115 | bool GLShader::createVertexShaderFromString(const char* pSource) 116 | { 117 | if (!createShader(pSource, GL_VERTEX_SHADER)) 118 | { 119 | return false; 120 | } 121 | 122 | return true; 123 | } 124 | 125 | 126 | bool GLShader::createFragmentShaderFromString(const char* pSource) 127 | { 128 | if (!createShader(pSource, GL_FRAGMENT_SHADER)) 129 | { 130 | return false; 131 | } 132 | 133 | return true; 134 | } 135 | 136 | 137 | 138 | bool GLShader::buildProgram() 139 | { 140 | if (!m_uiVertexShader || !m_uiFragmentShader) 141 | { 142 | return false; 143 | } 144 | 145 | if (m_uiProgram) 146 | { 147 | glDeleteProgram(m_uiProgram); 148 | } 149 | 150 | m_uiProgram = glCreateProgram(); 151 | 152 | glAttachShader(m_uiProgram, m_uiVertexShader); 153 | glAttachShader(m_uiProgram, m_uiFragmentShader); 154 | 155 | glLinkProgram(m_uiProgram); 156 | 157 | int nStatus; 158 | int nLength; 159 | char cMessage[256]; 160 | 161 | glGetProgramiv(m_uiProgram, GL_LINK_STATUS, &nStatus); 162 | 163 | if (nStatus != GL_TRUE) 164 | { 165 | glGetProgramInfoLog(m_uiProgram, 256, &nLength, cMessage); 166 | 167 | m_strErrorMessage = cMessage; 168 | 169 | return false; 170 | } 171 | 172 | return true; 173 | } 174 | 175 | 176 | 177 | bool GLShader::createShader(const char* pSource, unsigned int uiType) 178 | { 179 | unsigned int uiShader = 0; 180 | 181 | if (uiType == GL_VERTEX_SHADER) 182 | { 183 | m_uiVertexShader = glCreateShader(GL_VERTEX_SHADER); 184 | 185 | uiShader = m_uiVertexShader; 186 | } 187 | else if (uiType == GL_FRAGMENT_SHADER) 188 | { 189 | m_uiFragmentShader = glCreateShader(GL_FRAGMENT_SHADER); 190 | 191 | uiShader = m_uiFragmentShader; 192 | } 193 | 194 | glShaderSource(uiShader, 1, &pSource, NULL); 195 | 196 | glCompileShader(uiShader); 197 | 198 | int nStatus; 199 | int nLength; 200 | char cMessage[256]; 201 | 202 | glGetShaderiv(uiShader, GL_COMPILE_STATUS, &nStatus); 203 | 204 | if (nStatus != GL_TRUE) 205 | { 206 | glGetShaderInfoLog(uiShader, 256, &nLength, cMessage); 207 | 208 | m_strErrorMessage = cMessage; 209 | 210 | return false; 211 | } 212 | 213 | return true; 214 | } 215 | 216 | 217 | bool GLShader::readShaderSource(const char* pFileName, std::string &strSource) 218 | { 219 | string strLine; 220 | ifstream ShaderFile(pFileName); 221 | 222 | if (!ShaderFile.is_open()) 223 | return false; 224 | 225 | while(!ShaderFile.eof()) 226 | { 227 | getline(ShaderFile, strLine); 228 | strSource += strLine; 229 | strSource += "\n"; 230 | } 231 | 232 | return true; 233 | } 234 | 235 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/DOPPWin32.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | 14 | {A85BC28A-4DCF-4018-A076-B0D6B253AF9C} 15 | Win32Proj 16 | DOPPWin32 17 | DOPPEffectOpenGL 18 | 19 | 20 | 21 | Application 22 | true 23 | Unicode 24 | Dynamic 25 | 26 | 27 | Application 28 | false 29 | true 30 | Unicode 31 | Dynamic 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | true 45 | 46 | 47 | false 48 | 49 | 50 | 51 | 52 | 53 | Level3 54 | Disabled 55 | WIN32;_DEBUG;_WINDOWS;GLEW_STATIC;%(PreprocessorDefinitions) 56 | ../../external/glew-1.9.0/include;../../common/;../../external/;%(AdditionalIncludeDirectories) 57 | 58 | 59 | Windows 60 | true 61 | ../../external/glew-1.9.0/lib/win32-vc/;%(AdditionalLibraryDirectories) 62 | glew32sd.lib;OpenGL32.lib 63 | 64 | 65 | xcopy /Y "$(ProjectDir)data" "$(OutDir)data\" 66 | 67 | 68 | 69 | 70 | Level3 71 | 72 | 73 | MaxSpeed 74 | true 75 | true 76 | WIN32;NDEBUG;_WINDOWS;GLEW_STATIC;%(PreprocessorDefinitions) 77 | ../../external/glew-1.9.0/include;../../external/glf;../../external/glm-0.9.3.3\;../../external/gli-0.3.1.0\;../../common/;../../external/;%(AdditionalIncludeDirectories) 78 | 79 | 80 | Windows 81 | true 82 | true 83 | true 84 | ../../external/glew-1.9.0/lib/win32-vc/;%(AdditionalLibraryDirectories) 85 | glew32s.lib;OpenGL32.lib 86 | false 87 | 88 | 89 | xcopy /Y "$(ProjectDir)data" "$(OutDir)data\" 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/GLDOPPEngine.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | 50 | #include "stdafx.h" 51 | 52 | #include 53 | #include 54 | 55 | #include "GLShader.h" 56 | #include "GLDOPPEngine.h" 57 | 58 | #define DOPP2 59 | 60 | #define GL_WAIT_FOR_PREVIOUS_VSYNC 0x931C 61 | 62 | typedef GLuint (APIENTRY* PFNWGLGETDESKTOPTEXTUREAMD)(void); 63 | typedef void (APIENTRY* PFNWGLENABLEPOSTPROCESSAMD)(bool enable); 64 | typedef GLuint (APIENTRY* WGLGENPRESENTTEXTUREAMD)(void); 65 | typedef GLboolean (APIENTRY* WGLDESKTOPTARGETAMD) (GLuint); 66 | typedef GLuint (APIENTRY* PFNWGLPRESENTTEXTURETOVIDEOAMD)(GLuint presentTexture, const GLuint* attrib_list); 67 | 68 | PFNWGLGETDESKTOPTEXTUREAMD wglGetDesktopTextureAMD; 69 | PFNWGLENABLEPOSTPROCESSAMD wglEnablePostProcessAMD; 70 | PFNWGLPRESENTTEXTURETOVIDEOAMD wglPresentTextureToVideoAMD; 71 | WGLDESKTOPTARGETAMD wglDesktopTargetAMD; 72 | WGLGENPRESENTTEXTUREAMD wglGenPresentTextureAMD; 73 | 74 | 75 | #define GET_PROC(xx) \ 76 | { \ 77 | void **x = (void**)&xx; \ 78 | *x = (void *) wglGetProcAddress(#xx); \ 79 | if (*x == NULL) { \ 80 | return false; \ 81 | } \ 82 | } 83 | 84 | 85 | 86 | 87 | 88 | GLDOPPEngine::GLDOPPEngine() : m_uiDesktopWidth(0), m_uiDesktopHeight(0), m_uiDesktopTexture(0), m_uiPresentTexture(0), 89 | m_uiFBO(0), m_uiBaseMap(0), m_pShader(NULL), m_uiVertexBuffer(0), m_uiVertexArray(0), 90 | m_bStartPostProcessing(false), m_bDoPresent(true) 91 | { 92 | } 93 | 94 | 95 | 96 | GLDOPPEngine::~GLDOPPEngine() 97 | { 98 | wglEnablePostProcessAMD(false); 99 | 100 | glFinish(); 101 | 102 | if (m_pShader) 103 | { 104 | delete m_pShader; 105 | m_pShader = NULL; 106 | } 107 | 108 | if (m_uiDesktopTexture) 109 | glDeleteTextures(1, &m_uiDesktopTexture); 110 | 111 | if (m_uiFBO) 112 | glDeleteFramebuffers(1, &m_uiFBO); 113 | 114 | if (m_uiVertexBuffer) 115 | glDeleteBuffers(1, &m_uiVertexBuffer); 116 | 117 | if (m_uiVertexArray) 118 | glDeleteVertexArrays(1, &m_uiVertexArray); 119 | } 120 | 121 | 122 | 123 | bool GLDOPPEngine::initDOPP(unsigned int uiDesktop, bool bPresent) 124 | { 125 | if (!setupDOPPExtension()) 126 | { 127 | return false; 128 | } 129 | 130 | // Select Desktop to be processed. ID is the same as seen in CCC 131 | if (!wglDesktopTargetAMD(uiDesktop)) 132 | { 133 | return false; 134 | } 135 | 136 | glActiveTexture(GL_TEXTURE1); 137 | 138 | // Get Desktop Texture. Instead of creating a regular texture we request the desktop texture 139 | m_uiDesktopTexture = wglGetDesktopTextureAMD(); 140 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture); 141 | 142 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 143 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 144 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 145 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 146 | 147 | // Get size of the desktop. Usually this is the same values as returned by GetSystemMetrics(SM_CXSCREEN) 148 | // and GetSystemMetrics(SM_CYSCREEN). In some cases it might differ, e.g. if a rotated desktop is used. 149 | glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, (GLint*)&m_uiDesktopWidth); 150 | glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, (GLint*)&m_uiDesktopHeight); 151 | 152 | glBindTexture(GL_TEXTURE_2D, 0); 153 | 154 | // Create FBO that is used to generate the present texture. We ill render into this FBO 155 | // in order to create the present texture 156 | glGenFramebuffers(1, &m_uiFBO); 157 | 158 | // generate present texture 159 | m_uiPresentTexture = wglGenPresentTextureAMD(); 160 | 161 | glBindTexture(GL_TEXTURE_2D, m_uiPresentTexture); 162 | 163 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 164 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 165 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 166 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 167 | 168 | glBindTexture(GL_TEXTURE_2D, 0); 169 | 170 | glBindFramebuffer(GL_FRAMEBUFFER, m_uiFBO); 171 | 172 | glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_uiPresentTexture, 0); 173 | 174 | GLenum FBStatus = glCheckFramebufferStatus(GL_FRAMEBUFFER); 175 | 176 | glBindFramebuffer(GL_FRAMEBUFFER, 0); 177 | 178 | if (FBStatus != GL_FRAMEBUFFER_COMPLETE) 179 | { 180 | return false; 181 | } 182 | 183 | m_bStartPostProcessing = bPresent; 184 | m_bDoPresent = bPresent; 185 | 186 | return true; 187 | } 188 | 189 | 190 | bool GLDOPPEngine::initEffect() 191 | { 192 | if (m_pShader) 193 | { 194 | delete m_pShader; 195 | } 196 | 197 | m_pShader = new GLShader; 198 | 199 | 200 | std::string const vertShaderSource(std::string("./data/base.vert")); 201 | std::string const fragShaderSource(std::string("./data/base.frag")); 202 | 203 | // Load basic shader 204 | if (!m_pShader->createVertexShaderFromFile((vertShaderSource.c_str())) ) 205 | { 206 | return false; 207 | } 208 | 209 | if (!m_pShader->createFragmentShaderFromFile(fragShaderSource.c_str())) 210 | { 211 | return false; 212 | } 213 | 214 | if (!m_pShader->buildProgram()) 215 | { 216 | return false; 217 | } 218 | 219 | m_pShader->bind(); 220 | 221 | m_uiBaseMap = glGetUniformLocation(m_pShader->getProgram(), "baseMap"); 222 | 223 | createQuad(); 224 | 225 | return true; 226 | } 227 | 228 | 229 | 230 | 231 | void GLDOPPEngine::processDesktop() 232 | { 233 | int pVP[4]; 234 | 235 | glGetIntegerv(GL_VIEWPORT, pVP); 236 | 237 | // Bind FBO that has the present texture attached 238 | glBindFramebuffer(GL_FRAMEBUFFER, m_uiFBO); 239 | 240 | // Set viewport for this FBO 241 | glViewport(0,0, m_uiDesktopWidth, m_uiDesktopHeight); 242 | 243 | // Render to FBO 244 | updateTexture(); 245 | 246 | glBindFramebuffer(GL_FRAMEBUFFER, 0); 247 | glBindTexture(GL_TEXTURE_2D, 0); 248 | 249 | if (m_bDoPresent) 250 | { 251 | const GLuint attrib[] = { GL_WAIT_FOR_PREVIOUS_VSYNC, 0 }; 252 | 253 | // Set the new desktop texture 254 | wglPresentTextureToVideoAMD(m_uiPresentTexture, attrib); 255 | 256 | if (m_bStartPostProcessing) 257 | { 258 | m_bStartPostProcessing = false; 259 | 260 | wglEnablePostProcessAMD(true); 261 | } 262 | 263 | glFinish(); 264 | } 265 | 266 | glBindFramebuffer(GL_FRAMEBUFFER, 0); 267 | 268 | // restore original viewport 269 | glViewport(pVP[0], pVP[1], pVP[2], pVP[3]); 270 | } 271 | 272 | 273 | 274 | void GLDOPPEngine::updateTexture() 275 | { 276 | m_pShader->bind(); 277 | 278 | glActiveTexture(GL_TEXTURE1); 279 | glBindTexture(GL_TEXTURE_2D, m_uiDesktopTexture); 280 | 281 | glUniform1i(m_uiBaseMap, 1); 282 | 283 | glBindVertexArray(m_uiVertexArray); 284 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 285 | glBindVertexArray(0); 286 | 287 | m_pShader->unbind(); 288 | } 289 | 290 | 291 | 292 | void GLDOPPEngine::createQuad() 293 | { 294 | const float vec[] = { -1.0f, 1.0f, 0.0f, 1.0f, -1.0f, -1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, -1.0f, 0.0f, 1.0f }; 295 | const float tex[] = { 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f }; 296 | 297 | glGenVertexArrays(1, &m_uiVertexArray); 298 | glBindVertexArray(m_uiVertexArray); 299 | 300 | glGenBuffers(1, &m_uiVertexBuffer); 301 | glBindBuffer(GL_ARRAY_BUFFER, m_uiVertexBuffer); 302 | 303 | glBufferData(GL_ARRAY_BUFFER, 24*sizeof(float), vec, GL_STATIC_DRAW); 304 | glBufferSubData(GL_ARRAY_BUFFER, 16*sizeof(float), 8*sizeof(float), tex); 305 | 306 | glEnableVertexAttribArray(0); 307 | glEnableVertexAttribArray(4); 308 | 309 | glVertexAttribPointer((GLuint)0, 4, GL_FLOAT, GL_FALSE, 0, 0); 310 | glVertexAttribPointer((GLuint)4, 2, GL_FLOAT, GL_FALSE, 0, (void*)(16*sizeof(float))); 311 | 312 | glBindBuffer(GL_ARRAY_BUFFER, 0); 313 | glBindVertexArray(0); 314 | } 315 | 316 | 317 | bool GLDOPPEngine::setupDOPPExtension() 318 | { 319 | GET_PROC(wglGetDesktopTextureAMD); 320 | GET_PROC(wglEnablePostProcessAMD); 321 | GET_PROC(wglPresentTextureToVideoAMD); 322 | GET_PROC(wglDesktopTargetAMD); 323 | GET_PROC(wglGenPresentTextureAMD); 324 | 325 | return true; 326 | } -------------------------------------------------------------------------------- /common/GLWindow.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | 50 | #include "os_include.hpp" 51 | 52 | #include 53 | #include 54 | 55 | #if defined(WIN32) 56 | #include 57 | #define GETPROC GetProcAddress 58 | #endif 59 | 60 | 61 | 62 | #include "GLWindow.hpp" 63 | 64 | 65 | using namespace std; 66 | 67 | 68 | 69 | 70 | #ifdef WIN32 71 | void MyDebugFunc(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam) 72 | { 73 | MessageBoxA(NULL, message, "GL Debug Message", MB_ICONWARNING | MB_OK); 74 | } 75 | #endif 76 | 77 | 78 | GLWindow::GLWindow(const char *strWinName, const char* strClsaaName) 79 | { 80 | m_strClassName = strClsaaName; 81 | m_strWinName = strWinName; 82 | 83 | m_hDC = NULL; 84 | m_hGLRC = NULL; 85 | m_hWnd = NULL; 86 | 87 | m_uiWidth = 800; 88 | m_uiHeight = 600; 89 | 90 | m_uiPosX = 0; 91 | m_uiPosY = 0; 92 | 93 | tempWindow = 0; 94 | m_bFullScreen = false; 95 | } 96 | 97 | 98 | GLWindow::~GLWindow(void) 99 | { 100 | 101 | destroy(); 102 | } 103 | 104 | 105 | 106 | 107 | void GLWindow::resize(unsigned int uiWidth, unsigned int uiHeight) 108 | { 109 | m_uiWidth = uiWidth; 110 | m_uiHeight = uiHeight; 111 | } 112 | 113 | 114 | 115 | //---------------------------------------------------------------------------------------------- 116 | // Windows implementation functions 117 | //---------------------------------------------------------------------------------------------- 118 | 119 | #ifdef WIN32 120 | 121 | bool GLWindow::create(unsigned int uiWidth, unsigned int uiHeight, bool FullScreen, bool Stereo, bool Need10Bits, bool bDecoration) 122 | { 123 | if (!WindowCreation(uiWidth, uiHeight, FullScreen, bDecoration)) 124 | return false; 125 | tempWindow = 1; 126 | return SetSimplePF(Need10Bits, Stereo); 127 | 128 | 129 | } 130 | 131 | bool GLWindow::WindowCreation(unsigned int uiWidth, unsigned int uiHeight, bool FullScreen, bool bDecoration) 132 | { 133 | RECT WinSize; 134 | DWORD dwExStyle; 135 | DWORD dwStyle; 136 | 137 | m_bFullScreen = FullScreen; 138 | 139 | 140 | 141 | if (m_bFullScreen) 142 | { 143 | dwExStyle = WS_EX_APPWINDOW; 144 | dwStyle = WS_POPUP; 145 | } 146 | else 147 | { 148 | m_uiWidth = uiWidth; 149 | m_uiHeight = uiHeight; 150 | 151 | dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; 152 | 153 | if (bDecoration) 154 | { 155 | dwStyle = WS_OVERLAPPEDWINDOW; 156 | 157 | // Adjust window size so that the ClientArea has the initial size 158 | // of uiWidth and uiHeight 159 | WinSize.bottom = uiHeight; 160 | WinSize.left = 0; 161 | WinSize.right = uiWidth; 162 | WinSize.top = 0; 163 | 164 | AdjustWindowRect(&WinSize, WS_OVERLAPPEDWINDOW, false); 165 | 166 | 167 | 168 | if (WinSize.left < 0) 169 | { 170 | WinSize.right -= WinSize.left; 171 | WinSize.left = 0; 172 | } 173 | if (WinSize.top < 0) 174 | { 175 | WinSize.bottom -= WinSize.top; 176 | WinSize.top = 0; 177 | } 178 | m_uiWidth = WinSize.right - WinSize.left; 179 | m_uiHeight = WinSize.bottom - WinSize.top; 180 | 181 | } 182 | else 183 | dwStyle = WS_POPUP; 184 | } 185 | 186 | m_hWnd = CreateWindowExA( dwExStyle, 187 | m_strClassName.c_str(), 188 | m_strWinName.c_str(), 189 | dwStyle, 190 | m_uiPosX, 191 | m_uiPosY, 192 | m_uiWidth, 193 | m_uiHeight, 194 | NULL, 195 | NULL, 196 | (HINSTANCE)GetModuleHandle(NULL), 197 | NULL); 198 | 199 | if (!m_hWnd) 200 | return FALSE; 201 | 202 | return true; 203 | 204 | } 205 | 206 | 207 | bool GLWindow::SetSimplePF( bool Need10Bits, bool Stereo) 208 | { 209 | int nPixelFormat; 210 | 211 | pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); 212 | pfd.nVersion = 1; 213 | pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER ; 214 | pfd.iPixelType = PFD_TYPE_RGBA; 215 | pfd.cColorBits = 32; 216 | pfd.cRedBits = Need10Bits?10:8; 217 | pfd.cRedShift = 0; 218 | pfd.cGreenBits = Need10Bits?10:8; 219 | pfd.cGreenShift = 0; 220 | pfd.cBlueBits = Need10Bits?10:8; 221 | pfd.cBlueShift = 0; 222 | pfd.cAlphaBits = Need10Bits?2:8; 223 | pfd.cAlphaShift = 0; 224 | pfd.cAccumBits = 0; 225 | pfd.cAccumRedBits = 0; 226 | pfd.cAccumGreenBits = 0; 227 | pfd.cAccumBlueBits = 0; 228 | pfd.cAccumAlphaBits = 0; 229 | pfd.cDepthBits = 24; 230 | pfd.cStencilBits = 8; 231 | pfd.cAuxBuffers = 0; 232 | pfd.iLayerType = PFD_MAIN_PLANE; 233 | pfd.bReserved = 0; 234 | pfd.dwLayerMask = 0; 235 | pfd.dwVisibleMask = 0; 236 | pfd.dwDamageMask = 0; 237 | 238 | if (Stereo) 239 | pfd.dwFlags |= PFD_STEREO; 240 | 241 | m_hDC = GetDC(m_hWnd); 242 | 243 | if (!m_hDC) 244 | return false; 245 | 246 | nPixelFormat = ChoosePixelFormat(m_hDC, &pfd); 247 | 248 | if (!nPixelFormat) 249 | return false; 250 | 251 | SetPixelFormat(m_hDC, nPixelFormat, &pfd); 252 | 253 | DescribePixelFormat(m_hDC, nPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd); 254 | return true; 255 | } 256 | 257 | 258 | void GLWindow::destroy() 259 | { 260 | if (m_hGLRC) 261 | { 262 | wglMakeCurrent(m_hDC, NULL); 263 | wglDeleteContext(m_hGLRC); 264 | } 265 | 266 | if (m_hWnd) 267 | { 268 | ReleaseDC(m_hWnd, m_hDC); 269 | DestroyWindow(m_hWnd); 270 | m_hDC= NULL; 271 | m_hWnd = NULL; 272 | } 273 | } 274 | 275 | void GLWindow::open() 276 | { 277 | ShowWindow(m_hWnd, SW_SHOW); 278 | SetForegroundWindow(m_hWnd); 279 | SetFocus(m_hWnd); 280 | 281 | UpdateWindow(m_hWnd); 282 | } 283 | 284 | 285 | 286 | 287 | 288 | void GLWindow::makeCurrent() 289 | { 290 | wglMakeCurrent(m_hDC, m_hGLRC); 291 | } 292 | 293 | 294 | void GLWindow::swapBuffers() 295 | { 296 | SwapBuffers(m_hDC); 297 | } 298 | 299 | int GLWindow::GetAdvancedPF( int NBSamples) 300 | { 301 | m_hDC = GetDC(m_hWnd); 302 | 303 | if (!m_hDC) 304 | { 305 | std::cout<<"can't get a valid DC to create a context"<0) 330 | iAttributes[23] = GL_TRUE; 331 | if (pfd.dwFlags & PFD_STEREO) 332 | iAttributes[25] = GL_TRUE; 333 | 334 | const float fAttributes[] = {0.0f, 0.0f}; 335 | 336 | UINT numFormats = 0; 337 | int pixelFormat = 0; 338 | wglChoosePixelFormatARB(m_hDC, iAttributes, fAttributes, 1,&pixelFormat, &numFormats); 339 | return pixelFormat; 340 | } 341 | 342 | bool GLWindow::createContext(int NBSamples) 343 | { 344 | if (!m_hDC) 345 | return false; 346 | 347 | m_hGLRC = wglCreateContext(m_hDC); 348 | 349 | if (!m_hGLRC) 350 | return false; 351 | 352 | wglMakeCurrent( m_hDC, m_hGLRC ); 353 | 354 | if (glewInit() != GLEW_OK) 355 | { 356 | return false; 357 | } 358 | 359 | if (WGLEW_ARB_create_context) 360 | { 361 | destroy(); 362 | WindowCreation(m_uiWidth, m_uiHeight, m_bFullScreen); 363 | int newPF = GetAdvancedPF(NBSamples); 364 | 365 | SetPixelFormat(m_hDC, newPF, &pfd); 366 | DescribePixelFormat(m_hDC, newPF, sizeof(PIXELFORMATDESCRIPTOR), &pfd); 367 | 368 | 369 | 370 | 371 | int attribs[] = { 372 | WGL_CONTEXT_MAJOR_VERSION_ARB, SAMPLE_MAJOR_VERSION, 373 | WGL_CONTEXT_MINOR_VERSION_ARB, SAMPLE_MINOR_VERSION, 374 | WGL_CONTEXT_PROFILE_MASK_ARB , WGL_CONTEXT_CORE_PROFILE_BIT_ARB, 375 | #ifdef _DEBUG 376 | WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_DEBUG_BIT_ARB, 377 | #endif 378 | 0 379 | }; 380 | 381 | m_hGLRC = wglCreateContextAttribsARB(m_hDC, 0, attribs); 382 | 383 | if (m_hGLRC) 384 | { 385 | wglMakeCurrent(m_hDC, m_hGLRC); 386 | #ifdef _DEBUG 387 | glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)wglGetProcAddress("glDebugMessageControlARB"); 388 | glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)wglGetProcAddress("glDebugMessageCallbackARB"); 389 | glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)wglGetProcAddress("glDebugMessageInsertARB"); 390 | #endif 391 | tempWindow = 0; 392 | return true; 393 | } 394 | } 395 | tempWindow = 0; 396 | return false; 397 | } 398 | 399 | bool GLWindow::IsTempWindow() 400 | { 401 | return tempWindow==0?false:true; 402 | } 403 | 404 | void GLWindow::deleteContext() 405 | { 406 | wglMakeCurrent(m_hDC, NULL); 407 | wglDeleteContext(m_hGLRC); 408 | } 409 | 410 | #endif 411 | 412 | -------------------------------------------------------------------------------- /DOPPEffectOpenGL/DOPPWin32/DOPPEngineDlg.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | 50 | 51 | #include "stdafx.h" 52 | #include 53 | 54 | #include "DOPPEngine.h" 55 | #include "DOPPEngineDlg.h" 56 | #include "afxdialogex.h" 57 | 58 | #include 59 | #include 60 | 61 | #include "DOPPRotationDlg.h" 62 | #include "DisplayManager.h" 63 | #include "GLWindow.hpp" 64 | #include "GLDOPPEngine.h" 65 | #include "GLDOPPColorInvert.h" 66 | #include "GLDOPPDistort.h" 67 | #include "GLDOPPEdgeFilter.h" 68 | #include "GLDOPPRotate.h" 69 | 70 | 71 | static unsigned int g_uiWindowWidth = 800; 72 | static unsigned int g_uiWindowHeight = 600; 73 | 74 | using namespace std; 75 | 76 | LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 77 | 78 | 79 | 80 | CDOPPEngineDlg::CDOPPEngineDlg(CWnd* pParent ) : CDialogEx(CDOPPEngineDlg::IDD, pParent) 81 | { 82 | m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); 83 | 84 | m_dwThreadId = 0; 85 | m_bEngineRunning = false; 86 | m_hEngineThread = NULL; 87 | 88 | m_pEffectComboBox = NULL; 89 | m_pShowWinCheckBox = NULL; 90 | 91 | m_uiEffectSelection = 0; 92 | m_uiDesktopSelection = 0; 93 | 94 | m_pDisplayManager = NULL; 95 | 96 | m_pRotationDlg = NULL; 97 | } 98 | 99 | 100 | CDOPPEngineDlg::~CDOPPEngineDlg() 101 | { 102 | if (m_pDisplayManager) 103 | delete m_pDisplayManager; 104 | } 105 | 106 | void CDOPPEngineDlg::DoDataExchange(CDataExchange* pDX) 107 | { 108 | CDialogEx::DoDataExchange(pDX); 109 | } 110 | 111 | BEGIN_MESSAGE_MAP(CDOPPEngineDlg, CDialogEx) 112 | ON_WM_PAINT() 113 | ON_WM_QUERYDRAGICON() 114 | ON_COMMAND(IDC_START, &CDOPPEngineDlg::OnStart) 115 | ON_COMMAND(IDC_STOP, &CDOPPEngineDlg::OnStop) 116 | ON_COMMAND(IDC_EXIT, &CDOPPEngineDlg::OnExit) 117 | END_MESSAGE_MAP() 118 | 119 | 120 | // CDOPPEngineDlg message handlers 121 | 122 | BOOL CDOPPEngineDlg::OnInitDialog() 123 | { 124 | CDialogEx::OnInitDialog(); 125 | 126 | // Set the icon for this dialog. The framework does this automatically 127 | // when the application's main window is not a dialog 128 | SetIcon(m_hIcon, TRUE); // Set big icon 129 | SetIcon(m_hIcon, FALSE); // Set small icon 130 | 131 | m_pEffectComboBox = static_cast(GetDlgItem(IDC_COMBO_EFFECT)); 132 | 133 | m_pEffectComboBox->Clear(); 134 | m_pEffectComboBox->InsertString(0, _T("No Effect")); 135 | m_pEffectComboBox->InsertString(1, _T("Invert Colors")); 136 | m_pEffectComboBox->InsertString(2, _T("Edge Filter")); 137 | m_pEffectComboBox->InsertString(3, _T("Distort")); 138 | m_pEffectComboBox->InsertString(4, _T("Rotate")); 139 | 140 | m_pEffectComboBox->SetCurSel(0); 141 | m_uiEffectSelection = 0; 142 | 143 | m_pDisplayManager = new DisplayManager; 144 | 145 | m_pShowWinCheckBox = static_cast(GetDlgItem(IDC_CHECK_WINDOW)); 146 | 147 | m_pShowWinCheckBox->SetCheck(BST_UNCHECKED); 148 | 149 | m_pDesktopComboBox = static_cast(GetDlgItem(IDC_COMBO_DESKTOP)); 150 | 151 | m_pDesktopComboBox->Clear(); 152 | 153 | unsigned int uiNumDesktops = m_pDisplayManager->enumDisplays(); 154 | 155 | for (unsigned int i = 0; i < uiNumDesktops; ++i) 156 | { 157 | char buf[8]; 158 | 159 | // Add 1 to the id to have the matching Desktop Id with CCC 160 | sprintf_s(buf," %d", (i + 1)); 161 | 162 | m_pDesktopComboBox->InsertString(i, CA2CT(buf)); 163 | } 164 | 165 | m_pDesktopComboBox->SetCurSel(0); 166 | 167 | m_uiDesktopSelection = 0; 168 | 169 | m_pRotationDlg = new DOPPRotationDlg; 170 | 171 | return TRUE; // return TRUE unless you set the focus to a control 172 | } 173 | 174 | 175 | void CDOPPEngineDlg::OnPaint() 176 | { 177 | if (IsIconic()) 178 | { 179 | CPaintDC dc(this); 180 | 181 | SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); 182 | 183 | // Center icon in client rectangle 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 | // Draw the icon 192 | dc.DrawIcon(x, y, m_hIcon); 193 | } 194 | else 195 | { 196 | CDialogEx::OnPaint(); 197 | } 198 | } 199 | 200 | 201 | 202 | // The system calls this function to obtain the cursor to display while the user drags 203 | // the minimized window. 204 | HCURSOR CDOPPEngineDlg::OnQueryDragIcon() 205 | { 206 | return static_cast(m_hIcon); 207 | } 208 | 209 | 210 | void CDOPPEngineDlg::OnStart() 211 | { 212 | if (!m_bEngineRunning) 213 | { 214 | m_uiEffectSelection = m_pEffectComboBox->GetCurSel(); 215 | m_uiDesktopSelection = m_pDesktopComboBox->GetCurSel(); 216 | 217 | if (m_uiEffectSelection == ROTATE_DESKTOP && m_pRotationDlg) 218 | { 219 | if (m_pRotationDlg->DoModal() == IDOK) 220 | { 221 | m_uiRotationAngle = m_pRotationDlg->getAngle(); 222 | } 223 | else 224 | { 225 | return; 226 | } 227 | } 228 | 229 | m_hEngineThread = CreateThread(NULL, 0, reinterpret_cast(&CDOPPEngineDlg::threadFunction), this, 0, &m_dwThreadId); 230 | 231 | m_bEngineRunning = true; 232 | } 233 | } 234 | 235 | 236 | void CDOPPEngineDlg::OnStop() 237 | { 238 | if (m_bEngineRunning) 239 | { 240 | m_bEngineRunning = false; 241 | 242 | WaitForSingleObject(m_hEngineThread, INFINITE); 243 | } 244 | } 245 | 246 | 247 | 248 | void CDOPPEngineDlg::OnExit() 249 | { 250 | // stop thread if required 251 | OnStop(); 252 | 253 | OnOK(); 254 | } 255 | 256 | 257 | DWORD CDOPPEngineDlg::threadFunction(void* pData) 258 | { 259 | if (pData) 260 | { 261 | CDOPPEngineDlg* pInstance = reinterpret_cast(pData); 262 | 263 | pInstance->threadLoop(); 264 | } 265 | 266 | return 0; 267 | } 268 | 269 | 270 | DWORD CDOPPEngineDlg::threadLoop() 271 | { 272 | bool bCapture = false; 273 | 274 | bCapture = (m_pShowWinCheckBox->GetCheck() == BST_CHECKED); 275 | 276 | // Create window with ogl context to load extensions 277 | WNDCLASSEX wndclass; 278 | const LPCWSTR cClassName = _T("OGL"); 279 | const LPCWSTR cWindowName = _T("DOPP Capture"); 280 | 281 | // Register WindowClass for GL window 282 | wndclass.cbSize = sizeof(WNDCLASSEX); 283 | wndclass.style = CS_OWNDC; 284 | wndclass.lpfnWndProc = WndProc; 285 | wndclass.cbClsExtra = 0; 286 | wndclass.cbWndExtra = 0; 287 | wndclass.hInstance = (HINSTANCE)GetModuleHandle(NULL); 288 | wndclass.hIcon = (HICON)LoadImage((HINSTANCE)AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, LR_DEFAULTSIZE, LR_DEFAULTSIZE, NULL); 289 | wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); 290 | wndclass.hbrBackground = NULL; 291 | wndclass.lpszMenuName = NULL; 292 | wndclass.lpszClassName = cClassName; 293 | wndclass.hIconSm = (HICON)LoadImage((HINSTANCE)AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, LR_DEFAULTSIZE, LR_DEFAULTSIZE, NULL); 294 | 295 | if (!RegisterClassEx(&wndclass)) 296 | return FALSE; 297 | 298 | GLWindow* pWin = new GLWindow("DOPP Capture", "OGL"); 299 | 300 | pWin->create(g_uiWindowWidth, g_uiWindowHeight, false, false, false, true); 301 | 302 | // GLWindow::create context will destroy the initial window and create a new one. To avoid that 303 | // WndProc emits a PostQuitMessage a pointer to the initial window is passed. If this pointer is 304 | // valid we know that it is the temporary window and should not emit PostQuitMessage. 305 | SetWindowLongPtr(pWin->getWnd(), GWLP_USERDATA, reinterpret_cast(pWin)); 306 | 307 | pWin->createContext(0); 308 | 309 | GLDOPPEngine* pEngine = NULL; 310 | 311 | switch (m_uiEffectSelection) 312 | { 313 | case COLOR_INVERT: 314 | pEngine = new GLDOPPColorInvert; 315 | break; 316 | 317 | case EDGE_FILTER: 318 | pEngine = new GLDOPPEdgeFilter; 319 | break; 320 | 321 | case DISTORT_EFFECT: 322 | pEngine = new GLDOPPDistort; 323 | break; 324 | 325 | case ROTATE_DESKTOP: 326 | pEngine = new GLDOPPRotate; 327 | break; 328 | 329 | default: 330 | pEngine = new GLDOPPEngine; 331 | break; 332 | } 333 | 334 | // m_uiDesktopSelection is the id of the selected element in the Combo Box 335 | // Need to add 1 to get the desktop id as shown in CCC 336 | if (!pEngine->initDOPP(m_uiDesktopSelection + 1)) 337 | { 338 | // prevent thread loop to start due to error 339 | m_bEngineRunning = false; 340 | } 341 | 342 | 343 | 344 | if (!pEngine->initEffect()) 345 | { 346 | // prevent thread loop to start due to error 347 | m_bEngineRunning = false; 348 | } 349 | 350 | 351 | if (m_bEngineRunning && m_uiEffectSelection == ROTATE_DESKTOP) 352 | { 353 | GLDOPPRotate* pRot = dynamic_cast(pEngine); 354 | pRot->setRotation((float)m_uiRotationAngle); 355 | } 356 | 357 | 358 | 359 | if (bCapture && m_bEngineRunning) 360 | { 361 | // Open window only if this option was checked in the GUI 362 | pWin->open(); 363 | } 364 | 365 | // Enable SW mouse 366 | SystemParametersInfo(SPI_SETMOUSETRAILS, 2, 0, 0); 367 | 368 | MSG mMsg; 369 | 370 | while(m_bEngineRunning) 371 | { 372 | pEngine->processDesktop(); 373 | 374 | if (bCapture) 375 | { 376 | // Blit FBO of DOPPEngine into the window 377 | glViewport(0, 0, g_uiWindowWidth, g_uiWindowHeight); 378 | 379 | glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); 380 | glBindFramebuffer(GL_READ_FRAMEBUFFER, pEngine->getPresentBuffer()); 381 | 382 | glBlitFramebuffer(0, pEngine->getDesktopHeight(), pEngine->getDesktopWidth(), 0, 0, 0, g_uiWindowWidth, g_uiWindowHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR); 383 | 384 | glBindFramebuffer(GL_FRAMEBUFFER, 0); 385 | 386 | pWin->swapBuffers(); 387 | 388 | if (PeekMessage(&mMsg, NULL, 0, 0, PM_REMOVE)) 389 | { 390 | if (mMsg.message == WM_QUIT) 391 | { 392 | m_bEngineRunning = false; 393 | } 394 | else 395 | { 396 | TranslateMessage(&mMsg); 397 | DispatchMessage(&mMsg); 398 | } 399 | } 400 | } 401 | } 402 | 403 | // Disable SW mouse 404 | SystemParametersInfo(SPI_SETMOUSETRAILS, 1, 0, 0); 405 | 406 | delete pEngine; 407 | 408 | delete pWin; 409 | 410 | ::UnregisterClass(cClassName, NULL); 411 | 412 | return 0; 413 | } 414 | 415 | 416 | // Window proc for GL window 417 | LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 418 | { 419 | switch (uMsg) 420 | { 421 | case WM_CHAR: 422 | { 423 | char c = (char)wParam; 424 | 425 | if (c == VK_ESCAPE) 426 | PostQuitMessage(0); 427 | } 428 | return 0; 429 | 430 | 431 | case WM_SIZE: 432 | g_uiWindowWidth = LOWORD(lParam); 433 | g_uiWindowHeight = HIWORD(lParam); 434 | 435 | return 0; 436 | 437 | case WM_CREATE: 438 | return 0; 439 | 440 | case WM_DESTROY: 441 | GLWindow* pWin = reinterpret_cast(GetWindowLongPtr(hWnd, GWLP_USERDATA)); 442 | 443 | if (!pWin || !pWin->IsTempWindow()) 444 | PostQuitMessage(0); 445 | 446 | return 0; 447 | 448 | } 449 | 450 | return DefWindowProc(hWnd, uMsg, wParam, lParam); 451 | } 452 | 453 | -------------------------------------------------------------------------------- /common/DisplayManager.cpp: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------------------- 2 | // 3 | // Copyright 2014 ADVANCED MICRO DEVICES, INC. All Rights Reserved. 4 | // 5 | // AMD is granting you permission to use this software and documentation (if 6 | // any) (collectively, the "Materials") pursuant to the terms and conditions 7 | // of the Software License Agreement included with the Materials. If you do 8 | // not have a copy of the Software License Agreement, contact your AMD 9 | // representative for a copy. 10 | // You agree that you will not reverse engineer or decompile the Materials, 11 | // in whole or in part, except as allowed by applicable law. 12 | // 13 | // WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF 14 | // ANY KIND. AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY, 15 | // INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE 17 | // WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF 18 | // TRADE OR COURSE OF USAGE. THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE 19 | // SOFTWARE IS ASSUMED BY YOU. 20 | // Some jurisdictions do not allow the exclusion of implied warranties, so 21 | // the above exclusion may not apply to You. 22 | // 23 | // LIMITATION OF LIABILITY AND INDEMNIFICATION: AMD AND ITS LICENSORS WILL 24 | // NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT, 25 | // INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF 26 | // THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN 27 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 28 | // In no event shall AMD's total liability to You for all damages, losses, 29 | // and causes of action (whether in contract, tort (including negligence) or 30 | // otherwise) exceed the amount of $100 USD. You agree to defend, indemnify 31 | // and hold harmless AMD and its licensors, and any of their directors, 32 | // officers, employees, affiliates or agents from and against any and all 33 | // loss, damage, liability and other expenses (including reasonable attorneys' 34 | // fees), resulting from Your use of the Software or violation of the terms and 35 | // conditions of this Agreement. 36 | // 37 | // U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED 38 | // RIGHTS." Use, duplication, or disclosure by the Government is subject to the 39 | // restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or 40 | // its successor. Use of the Materials by the Government constitutes 41 | // acknowledgement of AMD's proprietary rights in them. 42 | // 43 | // EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as 44 | // stated in the Software License Agreement. 45 | // 46 | //-------------------------------------------------------------------------------------- 47 | 48 | 49 | 50 | #include 51 | #include 52 | #include 53 | 54 | #include "ADL/adl_sdk.h" 55 | 56 | #include "DisplayManager.h" 57 | 58 | typedef int ( *ADL_MAIN_CONTROL_CREATE ) (ADL_MAIN_MALLOC_CALLBACK, int ); 59 | typedef int ( *ADL_MAIN_CONTROL_DESTROY ) (); 60 | typedef int ( *ADL_ADAPTER_NUMBEROFADAPTERS_GET ) ( int* ); 61 | typedef int ( *ADL_ADAPTER_ACTIVE_GET ) ( int, int* ); 62 | typedef int ( *ADL_ADAPTER_ADAPTERINFO_GET ) ( LPAdapterInfo, int ); 63 | typedef int ( *ADL_ADAPTER_ACTIVE_GET ) ( int, int* ); 64 | typedef int ( *ADL_DISPLAY_DISPLAYINFO_GET ) ( int, int *, ADLDisplayInfo **, int ); 65 | 66 | 67 | 68 | typedef struct 69 | { 70 | void* hDLL; 71 | ADL_MAIN_CONTROL_CREATE ADL_Main_Control_Create; 72 | ADL_MAIN_CONTROL_DESTROY ADL_Main_Control_Destroy; 73 | ADL_ADAPTER_NUMBEROFADAPTERS_GET ADL_Adapter_NumberOfAdapters_Get; 74 | ADL_ADAPTER_ACTIVE_GET ADL_Adapter_Active_Get; 75 | ADL_ADAPTER_ADAPTERINFO_GET ADL_Adapter_AdapterInfo_Get; 76 | ADL_DISPLAY_DISPLAYINFO_GET ADL_Display_DisplayInfo_Get; 77 | } ADLFunctions; 78 | 79 | 80 | static ADLFunctions g_AdlCalls = { 0, 0, 0, 0, 0, 0, 0 }; 81 | 82 | 83 | typedef struct DisplayData 84 | { 85 | unsigned int uiGPUId; 86 | unsigned int uiDisplayId; 87 | unsigned int uiDisplayLogicalId; 88 | int nOriginX; 89 | int nOriginY; 90 | unsigned int uiWidth; 91 | unsigned int uiHeight; 92 | std::string strDisplayname; 93 | } DISPLAY_DATA; 94 | 95 | 96 | 97 | // Memory Allocation function needed for ADL 98 | void* __stdcall ADL_Alloc ( int iSize ) 99 | { 100 | void* lpBuffer = malloc ( iSize ); 101 | return lpBuffer; 102 | } 103 | 104 | // Memory Free function needed for ADL 105 | void __stdcall ADL_Free ( void* lpBuffer ) 106 | { 107 | if ( NULL != lpBuffer ) 108 | { 109 | free ( lpBuffer ); 110 | lpBuffer = NULL; 111 | } 112 | } 113 | 114 | 115 | using namespace std; 116 | 117 | 118 | DisplayManager::DisplayManager() 119 | { 120 | m_uiNumGPU = 0; 121 | 122 | m_Displays.clear(); 123 | } 124 | 125 | 126 | DisplayManager::~DisplayManager() 127 | { 128 | deleteDisplays(); 129 | } 130 | 131 | 132 | unsigned int DisplayManager::enumDisplays() 133 | { 134 | int nNumDisplays = 0; 135 | int nNumAdapters = 0; 136 | int nCurrentBusNumber = 0; 137 | LPAdapterInfo pAdapterInfo = NULL; 138 | unsigned int uiCurrentGPUId = 0; 139 | unsigned int uiCurrentDisplayId = 0; 140 | 141 | // load all required ADL functions 142 | if (!setupADL()) 143 | return 0; 144 | 145 | if (m_Displays.size() > 0) 146 | deleteDisplays(); 147 | 148 | // Determine how many adapters and displays are in the system 149 | g_AdlCalls.ADL_Adapter_NumberOfAdapters_Get(&nNumAdapters); 150 | 151 | if (nNumAdapters > 0) 152 | { 153 | pAdapterInfo = (LPAdapterInfo)ADL_Alloc( sizeof (AdapterInfo) * nNumAdapters ); 154 | memset ( pAdapterInfo,'\0', sizeof (AdapterInfo) * nNumAdapters ); 155 | } 156 | 157 | g_AdlCalls.ADL_Adapter_AdapterInfo_Get (pAdapterInfo, sizeof (AdapterInfo) * nNumAdapters); 158 | 159 | // Loop through all adapters 160 | for (int i = 0; i < nNumAdapters; ++i) 161 | { 162 | int nAdapterIdx; 163 | int nAdapterStatus; 164 | 165 | nAdapterIdx = pAdapterInfo[i].iAdapterIndex; 166 | 167 | g_AdlCalls.ADL_Adapter_Active_Get(nAdapterIdx, &nAdapterStatus); 168 | 169 | if (nAdapterStatus) 170 | { 171 | LPADLDisplayInfo pDisplayInfo = NULL; 172 | 173 | g_AdlCalls.ADL_Display_DisplayInfo_Get(nAdapterIdx, &nNumDisplays, &pDisplayInfo, 0); 174 | 175 | for (int j = 0; j < nNumDisplays; ++j) 176 | { 177 | // check if display is connected 178 | if (pDisplayInfo[j].iDisplayInfoValue & ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED) 179 | { 180 | // check if display is mapped on adapter 181 | if (pDisplayInfo[j].iDisplayInfoValue & ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED && pDisplayInfo[j].displayID.iDisplayLogicalAdapterIndex == nAdapterIdx) 182 | { 183 | if (nCurrentBusNumber == 0) 184 | { 185 | // Found first GPU in the system 186 | ++m_uiNumGPU; 187 | nCurrentBusNumber = pAdapterInfo[nAdapterIdx].iBusNumber; 188 | } 189 | else if (nCurrentBusNumber != pAdapterInfo[nAdapterIdx].iBusNumber) 190 | { 191 | // found new GPU 192 | ++m_uiNumGPU; 193 | ++uiCurrentGPUId; 194 | nCurrentBusNumber = pAdapterInfo[nAdapterIdx].iBusNumber; 195 | } 196 | 197 | // Found mapped display, store relevant information 198 | DisplayData* pDsp = new DisplayData; 199 | 200 | pDsp->uiGPUId = uiCurrentGPUId; 201 | pDsp->uiDisplayId = uiCurrentDisplayId; 202 | pDsp->uiDisplayLogicalId = pDisplayInfo[j].displayID.iDisplayLogicalIndex; 203 | pDsp->strDisplayname = string(pAdapterInfo[i].strDisplayName); 204 | pDsp->nOriginX = 0; 205 | pDsp->nOriginY = 0; 206 | pDsp->uiWidth = 0; 207 | pDsp->uiHeight = 0; 208 | 209 | DEVMODEA DevMode; 210 | memset((void*)&DevMode, 0, sizeof(DEVMODEA)); 211 | 212 | EnumDisplaySettingsA(pDsp->strDisplayname.c_str(), ENUM_CURRENT_SETTINGS, &DevMode); 213 | 214 | pDsp->nOriginX = DevMode.dmPosition.x; 215 | pDsp->nOriginY = DevMode.dmPosition.y; 216 | pDsp->uiWidth = DevMode.dmPelsWidth; 217 | pDsp->uiHeight = DevMode.dmPelsHeight; 218 | 219 | m_Displays.push_back(pDsp); 220 | 221 | ++uiCurrentDisplayId; 222 | } 223 | } 224 | } 225 | 226 | ADL_Free(pDisplayInfo); 227 | } 228 | } 229 | 230 | if (pAdapterInfo) 231 | ADL_Free(pAdapterInfo); 232 | 233 | return m_Displays.size(); 234 | } 235 | 236 | 237 | void DisplayManager::deleteDisplays() 238 | { 239 | vector::iterator itr; 240 | 241 | for (itr = m_Displays.begin(); itr != m_Displays.end(); ++itr) 242 | { 243 | if (*itr) 244 | delete (*itr); 245 | } 246 | 247 | m_Displays.clear(); 248 | 249 | m_uiNumGPU = 0; 250 | } 251 | 252 | 253 | unsigned int DisplayManager::getNumGPUs() 254 | { 255 | if (m_Displays.size() > 0) 256 | return m_uiNumGPU; 257 | 258 | return 0; 259 | } 260 | 261 | 262 | unsigned int DisplayManager::getNumDisplays() 263 | { 264 | return m_Displays.size(); 265 | } 266 | 267 | 268 | unsigned int DisplayManager::getNumDisplaysOnGPU(unsigned int uiGPU) 269 | { 270 | unsigned int uiNumDsp = 0; 271 | vector::iterator itr; 272 | 273 | // loop through all display and check if they are on the requested GPU 274 | for (itr = m_Displays.begin(); itr != m_Displays.end(); ++itr) 275 | { 276 | if ((*itr)->uiGPUId == uiGPU) 277 | ++uiNumDsp; 278 | } 279 | 280 | return uiNumDsp; 281 | } 282 | 283 | 284 | unsigned int DisplayManager::getDisplayOnGPU(unsigned int uiGPU, unsigned int n) 285 | { 286 | unsigned int uiCurrentDisplayOnGpu = 0; 287 | 288 | vector::iterator itr; 289 | 290 | // loop through all display and return the n-th display that is on GPU uiGPU 291 | for (itr = m_Displays.begin(); itr != m_Displays.end(); ++itr) 292 | { 293 | if ((*itr)->uiGPUId == uiGPU) 294 | { 295 | if (uiCurrentDisplayOnGpu == n) 296 | { 297 | return (*itr)->uiDisplayId; 298 | } 299 | 300 | ++uiCurrentDisplayOnGpu; 301 | } 302 | } 303 | 304 | return 0; 305 | } 306 | 307 | 308 | const char* DisplayManager::getDisplayName(unsigned int uiDisplay) 309 | { 310 | if (uiDisplay < m_Displays.size()) 311 | { 312 | return m_Displays[uiDisplay]->strDisplayname.c_str(); 313 | } 314 | 315 | return NULL; 316 | } 317 | 318 | 319 | unsigned int DisplayManager::getGpuId(unsigned int uiDisplay) 320 | { 321 | if (uiDisplay < m_Displays.size()) 322 | { 323 | return m_Displays[uiDisplay]->uiGPUId; 324 | } 325 | 326 | return 0; 327 | } 328 | 329 | 330 | bool DisplayManager::getOrigin(unsigned int uiDisplay, int &nOriginX, int &nOriginY) 331 | { 332 | nOriginX = 0; 333 | nOriginY = 0; 334 | 335 | if (uiDisplay < m_Displays.size()) 336 | { 337 | nOriginX = m_Displays[uiDisplay]->nOriginX; 338 | nOriginY = m_Displays[uiDisplay]->nOriginY; 339 | 340 | return true; 341 | } 342 | 343 | return false; 344 | } 345 | 346 | 347 | bool DisplayManager::getSize(unsigned int uiDisplay, unsigned int &uiWidth, unsigned int &uiHeight) 348 | { 349 | uiWidth = 0; 350 | uiHeight = 0; 351 | 352 | if (uiDisplay < m_Displays.size()) 353 | { 354 | uiWidth = m_Displays[uiDisplay]->uiWidth; 355 | uiHeight = m_Displays[uiDisplay]->uiHeight; 356 | 357 | return true; 358 | } 359 | 360 | return false; 361 | } 362 | 363 | 364 | bool DisplayManager::setupADL() 365 | { 366 | // check if ADL was already loaded 367 | if (g_AdlCalls.hDLL) 368 | { 369 | return true; 370 | } 371 | 372 | g_AdlCalls.hDLL = (void*)LoadLibraryA("atiadlxx.dll"); 373 | 374 | if (g_AdlCalls.hDLL == NULL) 375 | g_AdlCalls.hDLL = (void*)LoadLibraryA("atiadlxy.dll"); 376 | 377 | 378 | if (!g_AdlCalls.hDLL) 379 | return false; 380 | 381 | // Get proc address of needed ADL functions 382 | g_AdlCalls.ADL_Main_Control_Create = (ADL_MAIN_CONTROL_CREATE)GetProcAddress((HMODULE)g_AdlCalls.hDLL,"ADL_Main_Control_Create"); 383 | if (!g_AdlCalls.ADL_Main_Control_Create) 384 | return false; 385 | 386 | g_AdlCalls.ADL_Main_Control_Destroy = (ADL_MAIN_CONTROL_DESTROY)GetProcAddress((HMODULE)g_AdlCalls.hDLL, "ADL_Main_Control_Destroy"); 387 | if (!g_AdlCalls.ADL_Main_Control_Destroy) 388 | return false; 389 | 390 | g_AdlCalls.ADL_Adapter_NumberOfAdapters_Get = (ADL_ADAPTER_NUMBEROFADAPTERS_GET)GetProcAddress((HMODULE)g_AdlCalls.hDLL,"ADL_Adapter_NumberOfAdapters_Get"); 391 | if (!g_AdlCalls.ADL_Adapter_NumberOfAdapters_Get) 392 | return false; 393 | 394 | g_AdlCalls.ADL_Adapter_AdapterInfo_Get = (ADL_ADAPTER_ADAPTERINFO_GET)GetProcAddress((HMODULE)g_AdlCalls.hDLL,"ADL_Adapter_AdapterInfo_Get"); 395 | if (!g_AdlCalls.ADL_Adapter_AdapterInfo_Get) 396 | return false; 397 | 398 | g_AdlCalls.ADL_Display_DisplayInfo_Get = (ADL_DISPLAY_DISPLAYINFO_GET)GetProcAddress((HMODULE)g_AdlCalls.hDLL,"ADL_Display_DisplayInfo_Get"); 399 | if (!g_AdlCalls.ADL_Display_DisplayInfo_Get) 400 | return false; 401 | 402 | g_AdlCalls.ADL_Adapter_Active_Get = (ADL_ADAPTER_ACTIVE_GET)GetProcAddress((HMODULE)g_AdlCalls.hDLL,"ADL_Adapter_Active_Get"); 403 | if (!g_AdlCalls.ADL_Adapter_Active_Get) 404 | return false; 405 | 406 | // Init ADL 407 | if (g_AdlCalls.ADL_Main_Control_Create(ADL_Alloc, 0) != ADL_OK) 408 | return false; 409 | 410 | return true; 411 | } 412 | 413 | 414 | 415 | 416 | -------------------------------------------------------------------------------- /external/ADL/adl_defines.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2008 - 2009 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_defines.h 9 | /// \brief Contains all definitions exposed by ADL for \ALL platforms.\n Included in ADL SDK 10 | /// 11 | /// This file contains all definitions used by ADL. 12 | /// The ADL definitions include the following: 13 | /// \li ADL error codes 14 | /// \li Enumerations for the ADLDisplayInfo structure 15 | /// \li Maximum limits 16 | /// 17 | 18 | #ifndef ADL_DEFINES_H_ 19 | #define ADL_DEFINES_H_ 20 | 21 | /// \defgroup DEFINES Constants and Definitions 22 | // @{ 23 | 24 | /// \defgroup define_misc Muscelaneous Constant Definitions 25 | // @{ 26 | 27 | /// \name General Definitions 28 | // @{ 29 | 30 | /// Defines ADL_TRUE 31 | #define ADL_TRUE 1 32 | /// Defines ADL_FALSE 33 | #define ADL_FALSE 0 34 | 35 | /// Defines the maximum string length 36 | #define ADL_MAX_CHAR 4096 37 | /// Defines the maximum string length 38 | #define ADL_MAX_PATH 256 39 | /// Defines the maximum number of supported adapters 40 | #define ADL_MAX_ADAPTERS 150 41 | /// Defines the maxumum number of supported displays 42 | #define ADL_MAX_DISPLAYS 150 43 | /// Defines the maxumum string length for device name 44 | #define ADL_MAX_DEVICENAME 32 45 | /// Defines for all adapters 46 | #define ADL_ADAPTER_INDEX_ALL -1 47 | /// Defines APIs with iOption none 48 | #define ADL_MAIN_API_OPTION_NONE 0 49 | // @} 50 | 51 | /// \name Definitions for iOption parameter used by 52 | /// ADL_Display_DDCBlockAccess_Get() 53 | // @{ 54 | 55 | /// Switch to DDC line 2 before sending the command to the display. 56 | #define ADL_DDC_OPTION_SWITCHDDC2 0x00000001 57 | /// Save command in the registry under a unique key, corresponding to parameter \b iCommandIndex 58 | #define ADL_DDC_OPTION_RESTORECOMMAND 0x00000002 59 | // @} 60 | 61 | /// \name Values for 62 | /// ADLI2C.iAction used with ADL_Display_WriteAndReadI2C() 63 | // @{ 64 | 65 | #define ADL_DL_I2C_ACTIONREAD 0x00000001 66 | #define ADL_DL_I2C_ACTIONWRITE 0x00000002 67 | #define ADL_DL_I2C_ACTIONREAD_REPEATEDSTART 0x00000003 68 | // @} 69 | 70 | 71 | // @} //Misc 72 | 73 | /// \defgroup define_adl_results Result Codes 74 | /// This group of definitions are the various results returned by all ADL functions \n 75 | // @{ 76 | /// All OK, but need to wait 77 | #define ADL_OK_WAIT 4 78 | /// All OK, but need restart 79 | #define ADL_OK_RESTART 3 80 | /// All OK but need mode change 81 | #define ADL_OK_MODE_CHANGE 2 82 | /// All OK, but with warning 83 | #define ADL_OK_WARNING 1 84 | /// ADL function completed successfully 85 | #define ADL_OK 0 86 | /// Generic Error. Most likely one or more of the Escape calls to the driver failed! 87 | #define ADL_ERR -1 88 | /// ADL not initialized 89 | #define ADL_ERR_NOT_INIT -2 90 | /// One of the parameter passed is invalid 91 | #define ADL_ERR_INVALID_PARAM -3 92 | /// One of the parameter size is invalid 93 | #define ADL_ERR_INVALID_PARAM_SIZE -4 94 | /// Invalid ADL index passed 95 | #define ADL_ERR_INVALID_ADL_IDX -5 96 | /// Invalid controller index passed 97 | #define ADL_ERR_INVALID_CONTROLLER_IDX -6 98 | /// Invalid display index passed 99 | #define ADL_ERR_INVALID_DIPLAY_IDX -7 100 | /// Function not supported by the driver 101 | #define ADL_ERR_NOT_SUPPORTED -8 102 | /// Null Pointer error 103 | #define ADL_ERR_NULL_POINTER -9 104 | /// Call can't be made due to disabled adapter 105 | #define ADL_ERR_DISABLED_ADAPTER -10 106 | /// Invalid Callback 107 | #define ADL_ERR_INVALID_CALLBACK -11 108 | /// Display Resource conflict 109 | #define ADL_ERR_RESOURCE_CONFLICT -12 110 | 111 | // @} 112 | /// 113 | 114 | /// \defgroup define_display_type Display Type 115 | /// Define Monitor/CRT display type 116 | // @{ 117 | /// Define Monitor display type 118 | #define ADL_DT_MONITOR 0 119 | /// Define TV display type 120 | #define ADL_DT_TELEVISION 1 121 | /// Define LCD display type 122 | #define ADL_DT_LCD_PANEL 2 123 | /// Define DFP display type 124 | #define ADL_DT_DIGITAL_FLAT_PANEL 3 125 | /// Define Componment Video display type 126 | #define ADL_DT_COMPONENT_VIDEO 4 127 | /// Define Projector display type 128 | #define ADL_DT_PROJECTOR 5 129 | // @} 130 | 131 | /// \defgroup define_display_connection_type Display Connection Type 132 | // @{ 133 | /// Define unknown display output type 134 | #define ADL_DOT_UNKNOWN 0 135 | /// Define composite display output type 136 | #define ADL_DOT_COMPOSITE 1 137 | /// Define SVideo display output type 138 | #define ADL_DOT_SVIDEO 2 139 | /// Define analog display output type 140 | #define ADL_DOT_ANALOG 3 141 | /// Define digital display output type 142 | #define ADL_DOT_DIGITAL 4 143 | // @} 144 | 145 | /// \defgroup define_color_type Display Color Type and Source 146 | /// Define Display Color Type and Source 147 | // @{ 148 | #define ADL_DISPLAY_COLOR_BRIGHTNESS (1 << 0) 149 | #define ADL_DISPLAY_COLOR_CONTRAST (1 << 1) 150 | #define ADL_DISPLAY_COLOR_SATURATION (1 << 2) 151 | #define ADL_DISPLAY_COLOR_HUE (1 << 3) 152 | #define ADL_DISPLAY_COLOR_TEMPERATURE (1 << 4) 153 | 154 | /// Color Temperature Source is EDID 155 | #define ADL_DISPLAY_COLOR_TEMPERATURE_SOURCE_EDID (1 << 5) 156 | /// Color Temperature Source is User 157 | #define ADL_DISPLAY_COLOR_TEMPERATURE_SOURCE_USER (1 << 6) 158 | // @} 159 | 160 | /// \defgroup define_adjustment_capabilities Display Adjustment Capabilities 161 | /// Display adjustment capabilities values. Returned by ADL_Display_AdjustCaps_Get 162 | // @{ 163 | #define ADL_DISPLAY_ADJUST_OVERSCAN (1 << 0) 164 | #define ADL_DISPLAY_ADJUST_VERT_POS (1 << 1) 165 | #define ADL_DISPLAY_ADJUST_HOR_POS (1 << 2) 166 | #define ADL_DISPLAY_ADJUST_VERT_SIZE (1 << 3) 167 | #define ADL_DISPLAY_ADJUST_HOR_SIZE (1 << 4) 168 | #define ADL_DISPLAY_ADJUST_SIZEPOS (ADL_DISPLAY_ADJUST_VERT_POS | ADL_DISPLAY_ADJUST_HOR_POS | ADL_DISPLAY_ADJUST_VERT_SIZE | ADL_DISPLAY_ADJUST_HOR_SIZE) 169 | #define ADL_DISPLAY_CUSTOMMODES (1<<5) 170 | #define ADL_DISPLAY_ADJUST_UNDERSCAN (1<<6) 171 | // @} 172 | 173 | 174 | /// \defgroup define_desktop_config Desktop Configuration Flags 175 | /// These flags are used by ADL_DesktopConfig_xxx 176 | // @{ 177 | #define ADL_DESKTOPCONFIG_UNKNOWN 0 /* UNKNOWN desktop config */ 178 | #define ADL_DESKTOPCONFIG_SINGLE (1 << 0) /* Single */ 179 | #define ADL_DESKTOPCONFIG_CLONE (1 << 2) /* Clone */ 180 | #define ADL_DESKTOPCONFIG_BIGDESK_H (1 << 4) /* Big Desktop Horizontal */ 181 | #define ADL_DESKTOPCONFIG_BIGDESK_V (1 << 5) /* Big Desktop Vertical */ 182 | #define ADL_DESKTOPCONFIG_BIGDESK_HR (1 << 6) /* Big Desktop Reverse Horz */ 183 | #define ADL_DESKTOPCONFIG_BIGDESK_VR (1 << 7) /* Big Desktop Reverse Vert */ 184 | #define ADL_DESKTOPCONFIG_RANDR12 (1 << 8) /* RandR 1.2 Multi-display */ 185 | // @} 186 | 187 | /// needed for ADLDDCInfo structure 188 | #define ADL_MAX_DISPLAY_NAME 256 189 | 190 | /// \defgroup define_edid_flags Values for ulDDCInfoFlag 191 | /// defines for ulDDCInfoFlag EDID flag 192 | // @{ 193 | #define ADL_DISPLAYDDCINFOEX_FLAG_PROJECTORDEVICE (1 << 0) 194 | #define ADL_DISPLAYDDCINFOEX_FLAG_EDIDEXTENSION (1 << 1) 195 | #define ADL_DISPLAYDDCINFOEX_FLAG_DIGITALDEVICE (1 << 2) 196 | #define ADL_DISPLAYDDCINFOEX_FLAG_HDMIAUDIODEVICE (1 << 3) 197 | #define ADL_DISPLAYDDCINFOEX_FLAG_SUPPORTS_AI (1 << 4) 198 | #define ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC601 (1 << 5) 199 | #define ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC709 (1 << 6) 200 | // @} 201 | 202 | /// \defgroup define_displayinfo_connector Display Connector Type 203 | /// defines for ADLDisplayInfo.iDisplayConnector 204 | // @{ 205 | #define ADL_DISPLAY_CONTYPE_UNKNOWN 0 206 | #define ADL_DISPLAY_CONTYPE_VGA 1 207 | #define ADL_DISPLAY_CONTYPE_DVI_D 2 208 | #define ADL_DISPLAY_CONTYPE_DVI_I 3 209 | #define ADL_DISPLAY_CONTYPE_ATICVDONGLE_NTSC 4 210 | #define ADL_DISPLAY_CONTYPE_ATICVDONGLE_JPN 5 211 | #define ADL_DISPLAY_CONTYPE_ATICVDONGLE_NONI2C_JPN 6 212 | #define ADL_DISPLAY_CONTYPE_ATICVDONGLE_NONI2C_NTSC 7 213 | #define ADL_DISPLAY_CONTYPE_HDMI_TYPE_A 10 214 | #define ADL_DISPLAY_CONTYPE_HDMI_TYPE_B 11 215 | #define ADL_DISPLAY_CONTYPE_SVIDEO 12 216 | #define ADL_DISPLAY_CONTYPE_COMPOSITE 13 217 | #define ADL_DISPLAY_CONTYPE_RCA_3COMPONENT 14 218 | #define ADL_DISPLAY_CONTYPE_DISPLAYPORT 15 219 | // @} 220 | 221 | /// TV Capabilities and Standards 222 | /// \defgroup define_tv_caps TV Capabilities and Standards 223 | // @{ 224 | #define ADL_TV_STANDARDS (1 << 0) 225 | #define ADL_TV_SCART (1 << 1) 226 | 227 | /// TV Standards Definitions 228 | #define ADL_STANDARD_NTSC_M (1 << 0) 229 | #define ADL_STANDARD_NTSC_JPN (1 << 1) 230 | #define ADL_STANDARD_NTSC_N (1 << 2) 231 | #define ADL_STANDARD_PAL_B (1 << 3) 232 | #define ADL_STANDARD_PAL_COMB_N (1 << 4) 233 | #define ADL_STANDARD_PAL_D (1 << 5) 234 | #define ADL_STANDARD_PAL_G (1 << 6) 235 | #define ADL_STANDARD_PAL_H (1 << 7) 236 | #define ADL_STANDARD_PAL_I (1 << 8) 237 | #define ADL_STANDARD_PAL_K (1 << 9) 238 | #define ADL_STANDARD_PAL_K1 (1 << 10) 239 | #define ADL_STANDARD_PAL_L (1 << 11) 240 | #define ADL_STANDARD_PAL_M (1 << 12) 241 | #define ADL_STANDARD_PAL_N (1 << 13) 242 | #define ADL_STANDARD_PAL_SECAM_D (1 << 14) 243 | #define ADL_STANDARD_PAL_SECAM_K (1 << 15) 244 | #define ADL_STANDARD_PAL_SECAM_K1 (1 << 16) 245 | #define ADL_STANDARD_PAL_SECAM_L (1 << 17) 246 | // @} 247 | 248 | 249 | /// \defgroup define_video_custom_mode Video Custom Mode flags 250 | /// Component Video Custom Mode flags. This is used by the iFlags parameter in ADLCustomMode 251 | // @{ 252 | #define ADL_CUSTOMIZEDMODEFLAG_MODESUPPORTED (1 << 0) 253 | #define ADL_CUSTOMIZEDMODEFLAG_NOTDELETETABLE (1 << 1) 254 | #define ADL_CUSTOMIZEDMODEFLAG_INSERTBYDRIVER (1 << 2) 255 | #define ADL_CUSTOMIZEDMODEFLAG_INTERLACED (1 << 3) 256 | #define ADL_CUSTOMIZEDMODEFLAG_BASEMODE (1 << 4) 257 | // @} 258 | 259 | /// \defgroup define_ddcinfoflag Values used for DDCInfoFlag 260 | /// ulDDCInfoFlag field values used by the ADLDDCInfo structure 261 | // @{ 262 | #define ADL_DISPLAYDDCINFOEX_FLAG_PROJECTORDEVICE (1 << 0) 263 | #define ADL_DISPLAYDDCINFOEX_FLAG_EDIDEXTENSION (1 << 1) 264 | #define ADL_DISPLAYDDCINFOEX_FLAG_DIGITALDEVICE (1 << 2) 265 | #define ADL_DISPLAYDDCINFOEX_FLAG_HDMIAUDIODEVICE (1 << 3) 266 | #define ADL_DISPLAYDDCINFOEX_FLAG_SUPPORTS_AI (1 << 4) 267 | #define ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC601 (1 << 5) 268 | #define ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC709 (1 << 6) 269 | // @} 270 | 271 | /// \defgroup define_cv_dongle Values used by ADL_CV_DongleSettings_xxx 272 | /// The following is applicable to ADL_DISPLAY_CONTYPE_ATICVDONGLE_JP and ADL_DISPLAY_CONTYPE_ATICVDONGLE_NONI2C_D only 273 | // @{ 274 | #define ADL_DISPLAY_CV_DONGLE_D1 (1 << 0) 275 | #define ADL_DISPLAY_CV_DONGLE_D2 (1 << 1) 276 | #define ADL_DISPLAY_CV_DONGLE_D3 (1 << 2) 277 | #define ADL_DISPLAY_CV_DONGLE_D4 (1 << 3) 278 | #define ADL_DISPLAY_CV_DONGLE_D5 (1 << 4) 279 | 280 | /// The following is applicable to ADL_DISPLAY_CONTYPE_ATICVDONGLE_NA and ADL_DISPLAY_CONTYPE_ATICVDONGLE_NONI2C only 281 | 282 | #define ADL_DISPLAY_CV_DONGLE_480I (1 << 0) 283 | #define ADL_DISPLAY_CV_DONGLE_480P (1 << 1) 284 | #define ADL_DISPLAY_CV_DONGLE_540P (1 << 2) 285 | #define ADL_DISPLAY_CV_DONGLE_720P (1 << 3) 286 | #define ADL_DISPLAY_CV_DONGLE_1080I (1 << 4) 287 | #define ADL_DISPLAY_CV_DONGLE_1080P (1 << 5) 288 | #define ADL_DISPLAY_CV_DONGLE_16_9 (1 << 6) 289 | #define ADL_DISPLAY_CV_DONGLE_720P50 (1 << 7) 290 | #define ADL_DISPLAY_CV_DONGLE_1080I25 (1 << 8) 291 | #define ADL_DISPLAY_CV_DONGLE_576I25 (1 << 9) 292 | #define ADL_DISPLAY_CV_DONGLE_576P50 (1 << 10) 293 | #define ADL_DISPLAY_CV_DONGLE_1080P24 (1 << 11) 294 | #define ADL_DISPLAY_CV_DONGLE_1080P25 (1 << 12) 295 | #define ADL_DISPLAY_CV_DONGLE_1080P30 (1 << 13) 296 | #define ADL_DISPLAY_CV_DONGLE_1080P50 (1 << 14) 297 | // @} 298 | 299 | /// \defgroup define_formats_ovr Formats Override Settings 300 | /// Display force modes flags 301 | // @{ 302 | /// 303 | #define ADL_DISPLAY_FORMAT_FORCE_720P 0x00000001 304 | #define ADL_DISPLAY_FORMAT_FORCE_1080I 0x00000002 305 | #define ADL_DISPLAY_FORMAT_FORCE_1080P 0x00000004 306 | #define ADL_DISPLAY_FORMAT_FORCE_720P50 0x00000008 307 | #define ADL_DISPLAY_FORMAT_FORCE_1080I25 0x00000010 308 | #define ADL_DISPLAY_FORMAT_FORCE_576I25 0x00000020 309 | #define ADL_DISPLAY_FORMAT_FORCE_576P50 0x00000040 310 | #define ADL_DISPLAY_FORMAT_FORCE_1080P24 0x00000080 311 | #define ADL_DISPLAY_FORMAT_FORCE_1080P25 0x00000100 312 | #define ADL_DISPLAY_FORMAT_FORCE_1080P30 0x00000200 313 | #define ADL_DISPLAY_FORMAT_FORCE_1080P50 0x00000400 314 | 315 | ///< Below are \b EXTENDED display mode flags 316 | 317 | #define ADL_DISPLAY_FORMAT_CVDONGLEOVERIDE 0x00000001 318 | #define ADL_DISPLAY_FORMAT_CVMODEUNDERSCAN 0x00000002 319 | #define ADL_DISPLAY_FORMAT_FORCECONNECT_SUPPORTED 0x00000004 320 | #define ADL_DISPLAY_FORMAT_RESTRICT_FORMAT_SELECTION 0x00000008 321 | #define ADL_DISPLAY_FORMAT_SETASPECRATIO 0x00000010 322 | #define ADL_DISPLAY_FORMAT_FORCEMODES 0x00000020 323 | #define ADL_DISPLAY_FORMAT_LCDRTCCOEFF 0x00000040 324 | // @} 325 | 326 | /// Defines used by OD5 327 | #define ADL_PM_PARAM_DONT_CHANGE 0 328 | 329 | /// The following defines Bus types 330 | // @{ 331 | #define ADL_BUSTYPE_PCI 0 /* PCI bus */ 332 | #define ADL_BUSTYPE_AGP 1 /* AGP bus */ 333 | #define ADL_BUSTYPE_PCIE 2 /* PCI Express bus */ 334 | #define ADL_BUSTYPE_PCIE_GEN2 3 /* PCI Express 2nd generation bus */ 335 | // @} 336 | 337 | /// \defgroup define_ws_caps Workstation Capabilities 338 | /// Workstation values 339 | // @{ 340 | 341 | /// This value indicates that the workstation card supports active stereo though stereo output connector 342 | #define ADL_STEREO_SUPPORTED (1 << 2) 343 | /// This value indicates that the workstation card supports active stereo via "blue-line" 344 | #define ADL_STEREO_BLUE_LINE (1 << 3) 345 | /// This value is used to turn off stereo mode. 346 | #define ADL_STEREO_OFF 0 347 | /// This value indicates that the workstation card supports active stereo. This is also used to set the stereo mode to active though the stereo output connector 348 | #define ADL_STEREO_ACTIVE (1 << 1) 349 | /// This value indicates that the workstation card supports auto-stereo monitors with horizontal interleave. This is also used to set the stereo mode to use the auto-stereo monitor with horizontal interleave 350 | #define ADL_STEREO_AUTO_HORIZONTAL (1 << 30) 351 | /// This value indicates that the workstation card supports auto-stereo monitors with vertical interleave. This is also used to set the stereo mode to use the auto-stereo monitor with vertical interleave 352 | #define ADL_STEREO_AUTO_VERTICAL (1 << 31) 353 | /// This value indicates that the workstation card supports passive stereo, ie. non stereo sync 354 | #define ADL_STEREO_PASSIVE (1 << 6) 355 | /// This value indicates that the workstation card supports auto-stereo monitors with vertical interleave. This is also used to set the stereo mode to use the auto-stereo monitor with vertical interleave 356 | #define ADL_STEREO_PASSIVE_HORIZ (1 << 7) 357 | /// This value indicates that the workstation card supports auto-stereo monitors with vertical interleave. This is also used to set the stereo mode to use the auto-stereo monitor with vertical interleave 358 | #define ADL_STEREO_PASSIVE_VERT (1 << 8) 359 | 360 | 361 | /// Load balancing is supported. 362 | #define ADL_WORKSTATION_LOADBALANCING_SUPPORTED 0x00000001 363 | /// Load balancing is available. 364 | #define ADL_WORKSTATION_LOADBALANCING_AVAILABLE 0x00000002 365 | 366 | /// Load balancing is disabled. 367 | #define ADL_WORKSTATION_LOADBALANCING_DISABLED 0x00000000 368 | /// Load balancing is Enabled. 369 | #define ADL_WORKSTATION_LOADBALANCING_ENABLED 0x00000001 370 | 371 | // @} 372 | 373 | /// \defgroup define_adapterspeed speed setting from the adapter 374 | // @{ 375 | #define ADL_CONTEXT_SPEED_UNFORCED 0 /* default asic running speed */ 376 | #define ADL_CONTEXT_SPEED_FORCEHIGH 1 /* asic running speed is forced to high */ 377 | #define ADL_CONTEXT_SPEED_FORCELOW 2 /* asic running speed is forced to low */ 378 | 379 | #define ADL_ADAPTER_SPEEDCAPS_SUPPORTED (1 << 0) /* change asic running speed setting is supported */ 380 | // @} 381 | 382 | /// \defgroup define_glsync Genlock related values 383 | /// GL-Sync port types (unique values) 384 | // @{ 385 | /// Unknown port of GL-Sync module 386 | #define ADL_GLSYNC_PORT_UNKNOWN 0 387 | /// BNC port of of GL-Sync module 388 | #define ADL_GLSYNC_PORT_BNC 1 389 | /// RJ45(1) port of of GL-Sync module 390 | #define ADL_GLSYNC_PORT_RJ45PORT1 2 391 | /// RJ45(2) port of of GL-Sync module 392 | #define ADL_GLSYNC_PORT_RJ45PORT2 3 393 | 394 | // GL-Sync Genlock settings mask (bit-vector) 395 | 396 | /// None of the ADLGLSyncGenlockConfig members are valid 397 | #define ADL_GLSYNC_CONFIGMASK_NONE 0 398 | /// The ADLGLSyncGenlockConfig.lSignalSource member is valid 399 | #define ADL_GLSYNC_CONFIGMASK_SIGNALSOURCE (1 << 0) 400 | /// The ADLGLSyncGenlockConfig.iSyncField member is valid 401 | #define ADL_GLSYNC_CONFIGMASK_SYNCFIELD (1 << 1) 402 | /// The ADLGLSyncGenlockConfig.iSampleRate member is valid 403 | #define ADL_GLSYNC_CONFIGMASK_SAMPLERATE (1 << 2) 404 | /// The ADLGLSyncGenlockConfig.lSyncDelay member is valid 405 | #define ADL_GLSYNC_CONFIGMASK_SYNCDELAY (1 << 3) 406 | /// The ADLGLSyncGenlockConfig.iTriggerEdge member is valid 407 | #define ADL_GLSYNC_CONFIGMASK_TRIGGEREDGE (1 << 4) 408 | /// The ADLGLSyncGenlockConfig.iScanRateCoeff member is valid 409 | #define ADL_GLSYNC_CONFIGMASK_SCANRATECOEFF (1 << 5) 410 | /// The ADLGLSyncGenlockConfig.lFramelockCntlVector member is valid 411 | #define ADL_GLSYNC_CONFIGMASK_FRAMELOCKCNTL (1 << 6) 412 | 413 | 414 | // GL-Sync Framelock control mask (bit-vector) 415 | 416 | /// Framelock is disabled 417 | #define ADL_GLSYNC_FRAMELOCKCNTL_NONE 0 418 | /// Framelock is enabled 419 | #define ADL_GLSYNC_FRAMELOCKCNTL_ENABLE ( 1 << 0) 420 | 421 | #define ADL_GLSYNC_FRAMELOCKCNTL_DISABLE ( 1 << 1) 422 | #define ADL_GLSYNC_FRAMELOCKCNTL_SWAP_COUNTER_RESET ( 1 << 2) 423 | #define ADL_GLSYNC_FRAMELOCKCNTL_SWAP_COUNTER_ACK ( 1 << 3) 424 | 425 | #define ADL_GLSYNC_FRAMELOCKCNTL_STATE_ENABLE ( 1 << 0) 426 | 427 | // GL-Sync Framelock counters mask (bit-vector) 428 | #define ADL_GLSYNC_COUNTER_SWAP ( 1 << 0 ) 429 | 430 | // GL-Sync Signal Sources (unique values) 431 | 432 | /// GL-Sync signal source is undefined 433 | #define ADL_GLSYNC_SIGNALSOURCE_UNDEFINED 0x00000100 434 | /// GL-Sync signal source is Free Run 435 | #define ADL_GLSYNC_SIGNALSOURCE_FREERUN 0x00000101 436 | /// GL-Sync signal source is the BNC GL-Sync port 437 | #define ADL_GLSYNC_SIGNALSOURCE_BNCPORT 0x00000102 438 | /// GL-Sync signal source is the RJ45(1) GL-Sync port 439 | #define ADL_GLSYNC_SIGNALSOURCE_RJ45PORT1 0x00000103 440 | /// GL-Sync signal source is the RJ45(2) GL-Sync port 441 | #define ADL_GLSYNC_SIGNALSOURCE_RJ45PORT2 0x00000104 442 | 443 | 444 | // GL-Sync Signal Types (unique values) 445 | 446 | /// GL-Sync signal type is unknown 447 | #define ADL_GLSYNC_SIGNALTYPE_UNDEFINED 0 448 | /// GL-Sync signal type is 480I 449 | #define ADL_GLSYNC_SIGNALTYPE_480I 1 450 | /// GL-Sync signal type is 576I 451 | #define ADL_GLSYNC_SIGNALTYPE_576I 2 452 | /// GL-Sync signal type is 480P 453 | #define ADL_GLSYNC_SIGNALTYPE_480P 3 454 | /// GL-Sync signal type is 576P 455 | #define ADL_GLSYNC_SIGNALTYPE_576P 4 456 | /// GL-Sync signal type is 720P 457 | #define ADL_GLSYNC_SIGNALTYPE_720P 5 458 | /// GL-Sync signal type is 1080P 459 | #define ADL_GLSYNC_SIGNALTYPE_1080P 6 460 | /// GL-Sync signal type is 1080I 461 | #define ADL_GLSYNC_SIGNALTYPE_1080I 7 462 | /// GL-Sync signal type is SDI 463 | #define ADL_GLSYNC_SIGNALTYPE_SDI 8 464 | /// GL-Sync signal type is TTL 465 | #define ADL_GLSYNC_SIGNALTYPE_TTL 9 466 | /// GL_Sync signal type is Analog 467 | #define ADL_GLSYNC_SIGNALTYPE_ANALOG 10 468 | 469 | // GL-Sync Sync Field options (unique values) 470 | 471 | ///GL-Sync sync field option is undefined 472 | #define ADL_GLSYNC_SYNCFIELD_UNDEFINED 0 473 | ///GL-Sync sync field option is Sync to Field 1 (used for Interlaced signal types) 474 | #define ADL_GLSYNC_SYNCFIELD_BOTH 1 475 | ///GL-Sync sync field option is Sync to Both fields (used for Interlaced signal types) 476 | #define ADL_GLSYNC_SYNCFIELD_1 2 477 | 478 | 479 | // GL-Sync trigger edge options (unique values) 480 | 481 | /// GL-Sync trigger edge is undefined 482 | #define ADL_GLSYNC_TRIGGEREDGE_UNDEFINED 0 483 | /// GL-Sync trigger edge is the rising edge 484 | #define ADL_GLSYNC_TRIGGEREDGE_RISING 1 485 | /// GL-Sync trigger edge is the falling edge 486 | #define ADL_GLSYNC_TRIGGEREDGE_FALLING 2 487 | /// GL-Sync trigger edge is both the rising and the falling edge 488 | #define ADL_GLSYNC_TRIGGEREDGE_BOTH 3 489 | 490 | 491 | // GL-Sync scan rate coefficient/multiplier options (unique values) 492 | 493 | /// GL-Sync scan rate coefficient/multiplier is undefined 494 | #define ADL_GLSYNC_SCANRATECOEFF_UNDEFINED 0 495 | /// GL-Sync scan rate coefficient/multiplier is 5 496 | #define ADL_GLSYNC_SCANRATECOEFF_x5 1 497 | /// GL-Sync scan rate coefficient/multiplier is 4 498 | #define ADL_GLSYNC_SCANRATECOEFF_x4 2 499 | /// GL-Sync scan rate coefficient/multiplier is 3 500 | #define ADL_GLSYNC_SCANRATECOEFF_x3 3 501 | /// GL-Sync scan rate coefficient/multiplier is 5:2 (SMPTE) 502 | #define ADL_GLSYNC_SCANRATECOEFF_x5_DIV_2 4 503 | /// GL-Sync scan rate coefficient/multiplier is 2 504 | #define ADL_GLSYNC_SCANRATECOEFF_x2 5 505 | /// GL-Sync scan rate coefficient/multiplier is 3 : 2 506 | #define ADL_GLSYNC_SCANRATECOEFF_x3_DIV_2 6 507 | /// GL-Sync scan rate coefficient/multiplier is 5 : 4 508 | #define ADL_GLSYNC_SCANRATECOEFF_x5_DIV_4 7 509 | /// GL-Sync scan rate coefficient/multiplier is 1 (default) 510 | #define ADL_GLSYNC_SCANRATECOEFF_x1 8 511 | /// GL-Sync scan rate coefficient/multiplier is 4 : 5 512 | #define ADL_GLSYNC_SCANRATECOEFF_x4_DIV_5 9 513 | /// GL-Sync scan rate coefficient/multiplier is 2 : 3 514 | #define ADL_GLSYNC_SCANRATECOEFF_x2_DIV_3 10 515 | /// GL-Sync scan rate coefficient/multiplier is 1 : 2 516 | #define ADL_GLSYNC_SCANRATECOEFF_x1_DIV_2 11 517 | /// GL-Sync scan rate coefficient/multiplier is 2 : 5 (SMPTE) 518 | #define ADL_GLSYNC_SCANRATECOEFF_x2_DIV_5 12 519 | /// GL-Sync scan rate coefficient/multiplier is 1 : 3 520 | #define ADL_GLSYNC_SCANRATECOEFF_x1_DIV_3 13 521 | /// GL-Sync scan rate coefficient/multiplier is 1 : 4 522 | #define ADL_GLSYNC_SCANRATECOEFF_x1_DIV_4 14 523 | /// GL-Sync scan rate coefficient/multiplier is 1 : 5 524 | #define ADL_GLSYNC_SCANRATECOEFF_x1_DIV_5 15 525 | 526 | 527 | // GL-Sync port (signal presence) states (unique values) 528 | 529 | /// GL-Sync port state is undefined 530 | #define ADL_GLSYNC_PORTSTATE_UNDEFINED 0 531 | /// GL-Sync port is not connected 532 | #define ADL_GLSYNC_PORTSTATE_NOCABLE 1 533 | /// GL-Sync port is Idle 534 | #define ADL_GLSYNC_PORTSTATE_IDLE 2 535 | /// GL-Sync port has an Input signal 536 | #define ADL_GLSYNC_PORTSTATE_INPUT 3 537 | /// GL-Sync port is Output 538 | #define ADL_GLSYNC_PORTSTATE_OUTPUT 4 539 | 540 | 541 | // GL-Sync LED types (used index within ADL_Workstation_GLSyncPortState_Get returned ppGlSyncLEDs array) (unique values) 542 | 543 | /// Index into the ADL_Workstation_GLSyncPortState_Get returned ppGlSyncLEDs array for the one LED of the BNC port 544 | #define ADL_GLSYNC_LEDTYPE_BNC 0 545 | /// Index into the ADL_Workstation_GLSyncPortState_Get returned ppGlSyncLEDs array for the Left LED of the RJ45(1) or RJ45(2) port 546 | #define ADL_GLSYNC_LEDTYPE_RJ45_LEFT 0 547 | /// Index into the ADL_Workstation_GLSyncPortState_Get returned ppGlSyncLEDs array for the Right LED of the RJ45(1) or RJ45(2) port 548 | #define ADL_GLSYNC_LEDTYPE_RJ45_RIGHT 1 549 | 550 | 551 | // GL-Sync LED colors (unique values) 552 | 553 | /// GL-Sync LED undefined color 554 | #define ADL_GLSYNC_LEDCOLOR_UNDEFINED 0 555 | /// GL-Sync LED is unlit 556 | #define ADL_GLSYNC_LEDCOLOR_NOLIGHT 1 557 | /// GL-Sync LED is yellow 558 | #define ADL_GLSYNC_LEDCOLOR_YELLOW 2 559 | /// GL-Sync LED is red 560 | #define ADL_GLSYNC_LEDCOLOR_RED 3 561 | /// GL-Sync LED is green 562 | #define ADL_GLSYNC_LEDCOLOR_GREEN 4 563 | /// GL-Sync LED is flashing green 564 | #define ADL_GLSYNC_LEDCOLOR_FLASH_GREEN 5 565 | 566 | 567 | // GL-Sync Port Control (refers one GL-Sync Port) (unique values) 568 | 569 | /// Used to configure the RJ54(1) or RJ42(2) port of GL-Sync is as Idle 570 | #define ADL_GLSYNC_PORTCNTL_NONE 0x00000000 571 | /// Used to configure the RJ54(1) or RJ42(2) port of GL-Sync is as Output 572 | #define ADL_GLSYNC_PORTCNTL_OUTPUT 0x00000001 573 | 574 | 575 | // GL-Sync Mode Control (refers one Display/Controller) (bitfields) 576 | 577 | /// Used to configure the display to use internal timing (not genlocked) 578 | #define ADL_GLSYNC_MODECNTL_NONE 0x00000000 579 | /// Bitfield used to configure the display as genlocked (either as Timing Client or as Timing Server) 580 | #define ADL_GLSYNC_MODECNTL_GENLOCK 0x00000001 581 | /// Bitfield used to configure the display as Timing Server 582 | #define ADL_GLSYNC_MODECNTL_TIMINGSERVER 0x00000002 583 | 584 | // GL-Sync Mode Status 585 | /// Display is currently not genlocked 586 | #define ADL_GLSYNC_MODECNTL_STATUS_NONE 0x00000000 587 | /// Display is currently genlocked 588 | #define ADL_GLSYNC_MODECNTL_STATUS_GENLOCK 0x00000001 589 | /// Display requires a mode switch 590 | #define ADL_GLSYNC_MODECNTL_STATUS_SETMODE_REQUIRED 0x00000002 591 | /// Display is capable of being genlocked 592 | #define ADL_GLSYNC_MODECNTL_STATUS_GENLOCK_ALLOWED 0x00000004 593 | 594 | #define ADL_MAX_GLSYNC_PORTS 8 595 | #define ADL_MAX_GLSYNC_PORT_LEDS 8 596 | 597 | // @} 598 | 599 | /// \defgroup define_crossfirestate CrossfireX state of a particular adapter CrossfireX combination 600 | // @{ 601 | #define ADL_XFIREX_STATE_NOINTERCONNECT ( 1 << 0 ) /* Dongle / cable is missing */ 602 | #define ADL_XFIREX_STATE_DOWNGRADEPIPES ( 1 << 1 ) /* CrossfireX can be enabled if pipes are downgraded */ 603 | #define ADL_XFIREX_STATE_DOWNGRADEMEM ( 1 << 2 ) /* CrossfireX cannot be enabled unless mem downgraded */ 604 | #define ADL_XFIREX_STATE_REVERSERECOMMENDED ( 1 << 3 ) /* Card reversal recommended, CrossfireX cannot be enabled. */ 605 | #define ADL_XFIREX_STATE_3DACTIVE ( 1 << 4 ) /* 3D client is active - CrossfireX cannot be safely enabled */ 606 | #define ADL_XFIREX_STATE_MASTERONSLAVE ( 1 << 5 ) /* Dongle is OK but master is on slave */ 607 | #define ADL_XFIREX_STATE_NODISPLAYCONNECT ( 1 << 6 ) /* No (valid) display connected to master card. */ 608 | #define ADL_XFIREX_STATE_NOPRIMARYVIEW ( 1 << 7 ) /* CrossfireX is enabled but master is not current primary device */ 609 | #define ADL_XFIREX_STATE_DOWNGRADEVISMEM ( 1 << 8 ) /* CrossfireX cannot be enabled unless visible mem downgraded */ 610 | #define ADL_XFIREX_STATE_LESSTHAN8LANE_MASTER ( 1 << 9 ) /* CrossfireX can be enabled however performance not optimal due to <8 lanes */ 611 | #define ADL_XFIREX_STATE_LESSTHAN8LANE_SLAVE ( 1 << 10 ) /* CrossfireX can be enabled however performance not optimal due to <8 lanes */ 612 | #define ADL_XFIREX_STATE_PEERTOPEERFAILED ( 1 << 11 ) /* CrossfireX cannot be enabled due to failed peer to peer test */ 613 | #define ADL_XFIREX_STATE_MEMISDOWNGRADED ( 1 << 16 ) /* Notification that memory is currently downgraded */ 614 | #define ADL_XFIREX_STATE_PIPESDOWNGRADED ( 1 << 17 ) /* Notification that pipes are currently downgraded */ 615 | #define ADL_XFIREX_STATE_XFIREXACTIVE ( 1 << 18 ) /* CrossfireX is enabled on current device */ 616 | #define ADL_XFIREX_STATE_VISMEMISDOWNGRADED ( 1 << 19 ) /* Notification that visible FB memory is currently downgraded */ 617 | #define ADL_XFIREX_STATE_INVALIDINTERCONNECTION ( 1 << 20 ) /* Cannot support current inter-connection configuration */ 618 | #define ADL_XFIREX_STATE_NONP2PMODE ( 1 << 21 ) /* CrossfireX will only work with clients supporting non P2P mode */ 619 | #define ADL_XFIREX_STATE_DOWNGRADEMEMBANKS ( 1 << 22 ) /* CrossfireX cannot be enabled unless memory banks downgraded */ 620 | #define ADL_XFIREX_STATE_MEMBANKSDOWNGRADED ( 1 << 23 ) /* Notification that memory banks are currently downgraded */ 621 | #define ADL_XFIREX_STATE_DUALDISPLAYSALLOWED ( 1 << 24 ) /* Extended desktop or clone mode is allowed. */ 622 | #define ADL_XFIREX_STATE_P2P_APERTURE_MAPPING ( 1 << 25 ) /* P2P mapping was through peer aperture */ 623 | #define ADL_XFIREX_STATE_P2PFLUSH_REQUIRED ADL_XFIREX_STATE_P2P_APERTURE_MAPPING /* For back compatible */ 624 | #define ADL_XFIREX_STATE_XSP_CONNECTED ( 1 << 26 ) /* There is CrossfireX side port connection between GPUs */ 625 | #define ADL_XFIREX_STATE_ENABLE_CF_REBOOT_REQUIRED ( 1 << 27 ) /* System needs a reboot bofore enable CrossfireX */ 626 | #define ADL_XFIREX_STATE_DISABLE_CF_REBOOT_REQUIRED ( 1 << 28 ) /* System needs a reboot after disable CrossfireX */ 627 | #define ADL_XFIREX_STATE_DRV_HANDLE_DOWNGRADE_KEY ( 1 << 29 ) /* Indicate base driver handles the downgrade key updating */ 628 | #define ADL_XFIREX_STATE_CF_RECONFIG_REQUIRED ( 1 << 30 ) /* CrossfireX need to be reconfigured by CCC because of a LDA chain broken */ 629 | #define ADL_XFIREX_STATE_ERRORGETTINGSTATUS ( 1 << 31 ) /* Could not obtain current status */ 630 | // @} 631 | 632 | /////////////////////////////////////////////////////////////////////////// 633 | // ADL_DISPLAY_ADJUSTMENT_PIXELFORMAT adjustment values 634 | // (bit-vector) 635 | /////////////////////////////////////////////////////////////////////////// 636 | /// \defgroup define_pixel_formats Pixel Formats values 637 | /// This group defines the various Pixel Formats that a particular digital display can support. \n 638 | /// Since a display can support multiple formats, these values can be bit-or'ed to indicate the various formats \n 639 | // @{ 640 | #define ADL_DISPLAY_PIXELFORMAT_UNKNOWN 0 641 | #define ADL_DISPLAY_PIXELFORMAT_RGB (1 << 0) 642 | #define ADL_DISPLAY_PIXELFORMAT_YCRCB444 (1 << 1) //Limited range 643 | #define ADL_DISPLAY_PIXELFORMAT_YCRCB422 (1 << 2) //Limited range 644 | #define ADL_DISPLAY_PIXELFORMAT_RGB_LIMITED_RANGE (1 << 3) 645 | #define ADL_DISPLAY_PIXELFORMAT_RGB_FULL_RANGE ADL_DISPLAY_PIXELFORMAT_RGB //Full range 646 | // @} 647 | 648 | /// \defgroup define_contype Connector Type Values 649 | /// ADLDisplayConfig.ulConnectorType defines 650 | // @{ 651 | #define ADL_DL_DISPLAYCONFIG_CONTYPE_UNKNOWN 0 652 | #define ADL_DL_DISPLAYCONFIG_CONTYPE_CV_NONI2C_JP 1 653 | #define ADL_DL_DISPLAYCONFIG_CONTYPE_CV_JPN 2 654 | #define ADL_DL_DISPLAYCONFIG_CONTYPE_CV_NA 3 655 | #define ADL_DL_DISPLAYCONFIG_CONTYPE_CV_NONI2C_NA 4 656 | #define ADL_DL_DISPLAYCONFIG_CONTYPE_VGA 5 657 | #define ADL_DL_DISPLAYCONFIG_CONTYPE_DVI_D 6 658 | #define ADL_DL_DISPLAYCONFIG_CONTYPE_DVI_I 7 659 | #define ADL_DL_DISPLAYCONFIG_CONTYPE_HDMI_TYPE_A 8 660 | #define ADL_DL_DISPLAYCONFIG_CONTYPE_HDMI_TYPE_B 9 661 | #define ADL_DL_DISPLAYCONFIG_CONTYPE_DISPLAYPORT 10 662 | // @} 663 | 664 | 665 | /////////////////////////////////////////////////////////////////////////// 666 | // ADL_DISPLAY_DISPLAYINFO_ Definitions 667 | // for ADLDisplayInfo.iDisplayInfoMask and ADLDisplayInfo.iDisplayInfoValue 668 | // (bit-vector) 669 | /////////////////////////////////////////////////////////////////////////// 670 | /// \defgroup define_displayinfomask Display Info Mask Values 671 | // @{ 672 | #define ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED 0x00000001 673 | #define ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED 0x00000002 674 | #define ADL_DISPLAY_DISPLAYINFO_NONLOCAL 0x00000004 675 | #define ADL_DISPLAY_DISPLAYINFO_FORCIBLESUPPORTED 0x00000008 676 | #define ADL_DISPLAY_DISPLAYINFO_GENLOCKSUPPORTED 0x00000010 677 | #define ADL_DISPLAY_DISPLAYINFO_MULTIVPU_SUPPORTED 0x00000020 678 | 679 | #define ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_SINGLE 0x00000100 680 | #define ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_CLONE 0x00000200 681 | 682 | /// Legacy support for XP 683 | #define ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2VSTRETCH 0x00000400 684 | #define ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2HSTRETCH 0x00000800 685 | #define ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_EXTENDED 0x00001000 686 | 687 | /// More support manners 688 | #define ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCH1GPU 0x00010000 689 | #define ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCHNGPU 0x00020000 690 | #define ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED2 0x00040000 691 | #define ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED3 0x00080000 692 | 693 | // @} 694 | 695 | 696 | /////////////////////////////////////////////////////////////////////////// 697 | // ADL_ADAPTER_DISPLAY_MANNER_SUPPORTED_ Definitions 698 | // for ADLAdapterDisplayCap of ADL_Adapter_Display_Cap() 699 | // (bit-vector) 700 | /////////////////////////////////////////////////////////////////////////// 701 | /// \defgroup define_adaptermanner Adapter Manner Support Values 702 | // @{ 703 | #define ADL_ADAPTER_DISPLAYCAP_MANNER_SUPPORTED_NOTACTIVE 0x00000001 704 | #define ADL_ADAPTER_DISPLAYCAP_MANNER_SUPPORTED_SINGLE 0x00000002 705 | #define ADL_ADAPTER_DISPLAYCAP_MANNER_SUPPORTED_CLONE 0x00000004 706 | #define ADL_ADAPTER_DISPLAYCAP_MANNER_SUPPORTED_NSTRETCH1GPU 0x00000008 707 | #define ADL_ADAPTER_DISPLAYCAP_MANNER_SUPPORTED_NSTRETCHNGPU 0x00000010 708 | 709 | /// Legacy support for XP 710 | #define ADL_ADAPTER_DISPLAYCAP_MANNER_SUPPORTED_2VSTRETCH 0x00000020 711 | #define ADL_ADAPTER_DISPLAYCAP_MANNER_SUPPORTED_2HSTRETCH 0x00000040 712 | #define ADL_ADAPTER_DISPLAYCAP_MANNER_SUPPORTED_EXTENDED 0x00000080 713 | 714 | #define ADL_ADAPTER_DISPLAYCAP_PREFERDISPLAY_SUPPORTED 0x00000100 715 | #define ADL_ADAPTER_DISPLAYCAP_BEZEL_SUPPORTED 0x00000200 716 | 717 | 718 | /////////////////////////////////////////////////////////////////////////// 719 | // ADL_DISPLAY_DISPLAYMAP_MANNER_ Definitions 720 | // for ADLDisplayMap.iDisplayMapMask and ADLDisplayMap.iDisplayMapValue 721 | // (bit-vector) 722 | /////////////////////////////////////////////////////////////////////////// 723 | #define ADL_DISPLAY_DISPLAYMAP_MANNER_RESERVED 0x00000001 724 | #define ADL_DISPLAY_DISPLAYMAP_MANNER_NOTACTIVE 0x00000002 725 | #define ADL_DISPLAY_DISPLAYMAP_MANNER_SINGLE 0x00000004 726 | #define ADL_DISPLAY_DISPLAYMAP_MANNER_CLONE 0x00000008 727 | #define ADL_DISPLAY_DISPLAYMAP_MANNER_RESERVED1 0x00000010 // Removed NSTRETCH 728 | #define ADL_DISPLAY_DISPLAYMAP_MANNER_HSTRETCH 0x00000020 729 | #define ADL_DISPLAY_DISPLAYMAP_MANNER_VSTRETCH 0x00000040 730 | #define ADL_DISPLAY_DISPLAYMAP_MANNER_VLD 0x00000080 731 | 732 | // @} 733 | 734 | /////////////////////////////////////////////////////////////////////////// 735 | // ADL_DISPLAY_DISPLAYMAP_OPTION_ Definitions 736 | // for iOption in function ADL_Display_DisplayMapConfig_Get 737 | // (bit-vector) 738 | /////////////////////////////////////////////////////////////////////////// 739 | #define ADL_DISPLAY_DISPLAYMAP_OPTION_GPUINFO 0x00000001 740 | 741 | /////////////////////////////////////////////////////////////////////////// 742 | // ADL_DISPLAY_DISPLAYTARGET_ Definitions 743 | // for ADLDisplayTarget.iDisplayTargetMask and ADLDisplayTarget.iDisplayTargetValue 744 | // (bit-vector) 745 | /////////////////////////////////////////////////////////////////////////// 746 | #define ADL_DISPLAY_DISPLAYTARGET_PREFERRED 0x00000001 747 | 748 | /////////////////////////////////////////////////////////////////////////// 749 | // ADL_DISPLAY_POSSIBLEMAPRESULT_VALID Definitions 750 | // for ADLPossibleMapResult.iPossibleMapResultMask and ADLPossibleMapResult.iPossibleMapResultValue 751 | // (bit-vector) 752 | /////////////////////////////////////////////////////////////////////////// 753 | #define ADL_DISPLAY_POSSIBLEMAPRESULT_VALID 0x00000001 754 | #define ADL_DISPLAY_POSSIBLEMAPRESULT_BEZELSUPPORTED 0x00000002 755 | 756 | 757 | /////////////////////////////////////////////////////////////////////////// 758 | // ADL_DISPLAY_MODE_ Definitions 759 | // for ADLMode.iModeMask, ADLMode.iModeValue, and ADLMode.iModeFlag 760 | // (bit-vector) 761 | /////////////////////////////////////////////////////////////////////////// 762 | /// \defgroup define_displaymode Display Mode Values 763 | // @{ 764 | #define ADL_DISPLAY_MODE_COLOURFORMAT_565 0x00000001 765 | #define ADL_DISPLAY_MODE_COLOURFORMAT_8888 0x00000002 766 | #define ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_000 0x00000004 767 | #define ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_090 0x00000008 768 | #define ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_180 0x00000010 769 | #define ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_270 0x00000020 770 | #define ADL_DISPLAY_MODE_REFRESHRATE_ROUNDED 0x00000040 771 | #define ADL_DISPLAY_MODE_REFRESHRATE_ONLY 0x00000080 772 | 773 | #define ADL_DISPLAY_MODE_PROGRESSIVE_FLAG 0 774 | #define ADL_DISPLAY_MODE_INTERLACED_FLAG 2 775 | // @} 776 | 777 | /////////////////////////////////////////////////////////////////////////// 778 | // ADL_OSMODEINFO Definitions 779 | /////////////////////////////////////////////////////////////////////////// 780 | /// \defgroup define_osmode OS Mode Values 781 | // @{ 782 | #define ADL_OSMODEINFOXPOS_DEFAULT -640 783 | #define ADL_OSMODEINFOYPOS_DEFAULT 0 784 | #define ADL_OSMODEINFOXRES_DEFAULT 640 785 | #define ADL_OSMODEINFOYRES_DEFAULT 480 786 | #define ADL_OSMODEINFOXRES_DEFAULT800 800 787 | #define ADL_OSMODEINFOYRES_DEFAULT600 600 788 | #define ADL_OSMODEINFOREFRESHRATE_DEFAULT 60 789 | #define ADL_OSMODEINFOCOLOURDEPTH_DEFAULT 8 790 | #define ADL_OSMODEINFOCOLOURDEPTH_DEFAULT16 16 791 | #define ADL_OSMODEINFOCOLOURDEPTH_DEFAULT24 24 792 | #define ADL_OSMODEINFOCOLOURDEPTH_DEFAULT32 32 793 | #define ADL_OSMODEINFOORIENTATION_DEFAULT 0 794 | #define ADL_OSMODEINFOORIENTATION_DEFAULT_WIN7 DISPLAYCONFIG_ROTATION_FORCE_UINT32 795 | #define ADL_OSMODEFLAG_DEFAULT 0 796 | // @} 797 | 798 | 799 | /////////////////////////////////////////////////////////////////////////// 800 | // ADLPurposeCode Enumeration 801 | /////////////////////////////////////////////////////////////////////////// 802 | enum ADLPurposeCode 803 | { 804 | ADL_PURPOSECODE_NORMAL = 0, 805 | ADL_PURPOSECODE_HIDE_MODE_SWITCH, 806 | ADL_PURPOSECODE_MODE_SWITCH, 807 | ADL_PURPOSECODE_ATTATCH_DEVICE, 808 | ADL_PURPOSECODE_DETACH_DEVICE, 809 | ADL_PURPOSECODE_SETPRIMARY_DEVICE, 810 | ADL_PURPOSECODE_GDI_ROTATION, 811 | ADL_PURPOSECODE_ATI_ROTATION, 812 | }; 813 | /////////////////////////////////////////////////////////////////////////// 814 | // ADLAngle Enumeration 815 | /////////////////////////////////////////////////////////////////////////// 816 | enum ADLAngle 817 | { 818 | ADL_ANGLE_LANDSCAPE = 0, 819 | ADL_ANGLE_ROTATERIGHT = 90, 820 | ADL_ANGLE_ROTATE180 = 180, 821 | ADL_ANGLE_ROTATELEFT = 270, 822 | }; 823 | 824 | /////////////////////////////////////////////////////////////////////////// 825 | // ADLOrientationDataType Enumeration 826 | /////////////////////////////////////////////////////////////////////////// 827 | enum ADLOrientationDataType 828 | { 829 | ADL_ORIENTATIONTYPE_OSDATATYPE, 830 | ADL_ORIENTATIONTYPE_NONOSDATATYPE 831 | }; 832 | 833 | /////////////////////////////////////////////////////////////////////////// 834 | // ADLPanningMode Enumeration 835 | /////////////////////////////////////////////////////////////////////////// 836 | enum ADLPanningMode 837 | { 838 | ADL_PANNINGMODE_NO_PANNING = 0, 839 | ADL_PANNINGMODE_AT_LEAST_ONE_NO_PANNING = 1, 840 | ADL_PANNINGMODE_ALLOW_PANNING = 2, 841 | }; 842 | 843 | /////////////////////////////////////////////////////////////////////////// 844 | // ADLLARGEDESKTOPTYPE Enumeration 845 | /////////////////////////////////////////////////////////////////////////// 846 | enum ADLLARGEDESKTOPTYPE 847 | { 848 | ADL_LARGEDESKTOPTYPE_NORMALDESKTOP = 0, 849 | ADL_LARGEDESKTOPTYPE_PSEUDOLARGEDESKTOP = 1, 850 | ADL_LARGEDESKTOPTYPE_VERYLARGEDESKTOP = 2, 851 | }; 852 | 853 | // Other Definitions for internal use 854 | 855 | // Values for ADL_Display_WriteAndReadI2CRev_Get() 856 | 857 | #define ADL_I2C_MAJOR_API_REV 0x00000001 858 | #define ADL_I2C_MINOR_DEFAULT_API_REV 0x00000000 859 | #define ADL_I2C_MINOR_OEM_API_REV 0x00000001 860 | 861 | // Values for ADL_Display_WriteAndReadI2C() 862 | #define ADL_DL_I2C_LINE_OEM 0x00000001 863 | #define ADL_DL_I2C_LINE_OD_CONTROL 0x00000002 864 | #define ADL_DL_I2C_LINE_OEM2 0x00000003 865 | 866 | // Max size of I2C data buffer 867 | #define ADL_DL_I2C_MAXDATASIZE 0x00000040 868 | #define ADL_DL_I2C_MAXWRITEDATASIZE 0x0000000C 869 | #define ADL_DL_I2C_MAXADDRESSLENGTH 0x00000006 870 | #define ADL_DL_I2C_MAXOFFSETLENGTH 0x00000004 871 | 872 | 873 | //values for ADLDisplayProperty.iPropertyType 874 | #define ADL_DL_DISPLAYPROPERTY_TYPE_UNKNOWN 0 875 | #define ADL_DL_DISPLAYPROPERTY_TYPE_EXPANSIONMODE 1 876 | #define ADL_DL_DISPLAYPROPERTY_TYPE_USEUNDERSCANSCALING 2 877 | 878 | //values for ADLDisplayProperty.iExpansionMode 879 | #define ADL_DL_DISPLAYPROPERTY_EXPANSIONMODE_CENTER 0 880 | #define ADL_DL_DISPLAYPROPERTY_EXPANSIONMODE_FULLSCREEN 1 881 | #define ADL_DL_DISPLAYPROPERTY_EXPANSIONMODE_ASPECTRATIO 2 882 | 883 | //values for ADL_Display_DitherState_Get 884 | #define ADL_DL_DISPLAY_DITHER_UNKNOWN 0 885 | #define ADL_DL_DISPLAY_DITHER_DISABLED 1 886 | #define ADL_DL_DISPLAY_DITHER_ENABLED 2 887 | 888 | /// Display Get Cached EDID flag 889 | #define ADL_MAX_EDIDDATA_SIZE 256 // number of UCHAR 890 | #define ADL_MAX_EDID_EXTENSION_BLOCKS 3 891 | 892 | #define ADL_DL_CONTROLLER_OVERLAY_ALPHA 0 893 | #define ADL_DL_CONTROLLER_OVERLAY_ALPHAPERPIX 1 894 | 895 | #define ADL_DL_DISPLAY_DATA_PACKET__INFO_PACKET_RESET 0x00000000 896 | #define ADL_DL_DISPLAY_DATA_PACKET__INFO_PACKET_SET 0x00000001 897 | 898 | ///\defgroup define_display_packet Display Data Packet Types 899 | // @{ 900 | #define ADL_DL_DISPLAY_DATA_PACKET__TYPE__AVI 0x00000001 901 | #define ADL_DL_DISPLAY_DATA_PACKET__TYPE__RESERVED 0x00000002 902 | #define ADL_DL_DISPLAY_DATA_PACKET__TYPE__VENDORINFO 0x00000004 903 | // @} 904 | 905 | // matrix types 906 | #define ADL_GAMUT_MATRIX_SD 1 // SD matrix i.e. BT601 907 | #define ADL_GAMUT_MATRIX_HD 2 // HD matrix i.e. BT709 908 | 909 | ///\defgroup define_clockinfo_flags Clock flags 910 | /// Used by ADLAdapterODClockInfo.iFlag 911 | // @{ 912 | #define ADL_DL_CLOCKINFO_FLAG_FULLSCREEN3DONLY 0x00000001 913 | #define ADL_DL_CLOCKINFO_FLAG_ALWAYSFULLSCREEN3D 0x00000002 914 | #define ADL_DL_CLOCKINFO_FLAG_VPURECOVERYREDUCED 0x00000004 915 | #define ADL_DL_CLOCKINFO_FLAG_THERMALPROTECTION 0x00000008 916 | // @} 917 | 918 | // Supported GPUs 919 | // ADL_Display_PowerXpressActiveGPU_Get() 920 | #define ADL_DL_POWERXPRESS_GPU_INTEGRATED 1 921 | #define ADL_DL_POWERXPRESS_GPU_DISCRETE 2 922 | 923 | // Possible values for lpOperationResult 924 | // ADL_Display_PowerXpressActiveGPU_Get() 925 | #define ADL_DL_POWERXPRESS_SWITCH_RESULT_STARTED 1 // Switch procedure has been started 926 | #define ADL_DL_POWERXPRESS_SWITCH_RESULT_DECLINED 2 // Switch procedure cannot be started 927 | #define ADL_DL_POWERXPRESS_SWITCH_RESULT_ALREADY 3 // System already has required status 928 | 929 | // PowerXpress support version 930 | // ADL_Display_PowerXpressVersion_Get() 931 | #define ADL_DL_POWERXPRESS_VERSION_MAJOR 2 // Current PowerXpress support version 2.0 932 | #define ADL_DL_POWERXPRESS_VERSION_MINOR 0 933 | 934 | #define ADL_DL_POWERXPRESS_VERSION (((ADL_DL_POWERXPRESS_VERSION_MAJOR) << 16) | ADL_DL_POWERXPRESS_VERSION_MINOR) 935 | 936 | //values for ADLThermalControllerInfo.iThermalControllerDomain 937 | #define ADL_DL_THERMAL_DOMAIN_OTHER 0 938 | #define ADL_DL_THERMAL_DOMAIN_GPU 1 939 | 940 | //values for ADLThermalControllerInfo.iFlags 941 | #define ADL_DL_THERMAL_FLAG_INTERRUPT 1 942 | #define ADL_DL_THERMAL_FLAG_FANCONTROL 2 943 | 944 | ///\defgroup define_fanctrl Fan speed cotrol 945 | /// Values for ADLFanSpeedInfo.iFlags 946 | // @{ 947 | #define ADL_DL_FANCTRL_SUPPORTS_PERCENT_READ 1 948 | #define ADL_DL_FANCTRL_SUPPORTS_PERCENT_WRITE 2 949 | #define ADL_DL_FANCTRL_SUPPORTS_RPM_READ 4 950 | #define ADL_DL_FANCTRL_SUPPORTS_RPM_WRITE 8 951 | // @} 952 | 953 | //values for ADLFanSpeedValue.iSpeedType 954 | #define ADL_DL_FANCTRL_SPEED_TYPE_PERCENT 1 955 | #define ADL_DL_FANCTRL_SPEED_TYPE_RPM 2 956 | 957 | //values for ADLFanSpeedValue.iFlags 958 | #define ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED 1 959 | 960 | // MVPU interfaces 961 | #define ADL_DL_MAX_MVPU_ADAPTERS 4 962 | #define MVPU_ADAPTER_0 0x00000001 963 | #define MVPU_ADAPTER_1 0x00000002 964 | #define MVPU_ADAPTER_2 0x00000004 965 | #define MVPU_ADAPTER_3 0x00000008 966 | #define ADL_DL_MAX_REGISTRY_PATH 256 967 | 968 | //values for ADLMVPUStatus.iStatus 969 | #define ADL_DL_MVPU_STATUS_OFF 0 970 | #define ADL_DL_MVPU_STATUS_ON 1 971 | 972 | // values for ASIC family 973 | ///\defgroup define_Asic_type Detailed asic types 974 | /// Defines for Adapter ASIC family type 975 | // @{ 976 | #define ADL_ASIC_UNDEFINED 0 977 | #define ADL_ASIC_DISCRETE (1 << 0) 978 | #define ADL_ASIC_INTEGRATED (1 << 1) 979 | #define ADL_ASIC_FIREGL (1 << 2) 980 | #define ADL_ASIC_FIREMV (1 << 3) 981 | #define ADL_ASIC_XGP (1 << 4) 982 | #define ADL_ASIC_FUSION (1 << 5) 983 | // @} 984 | 985 | ///\defgroup define_detailed_timing_flags Detailed Timimg Flags 986 | /// Defines for ADLDetailedTiming.sTimingFlags field 987 | // @{ 988 | #define ADL_DL_TIMINGFLAG_DOUBLE_SCAN 0x0001 989 | #define ADL_DL_TIMINGFLAG_INTERLACED 0x0002 990 | #define ADL_DL_TIMINGFLAG_H_SYNC_POLARITY 0x0004 991 | #define ADL_DL_TIMINGFLAG_V_SYNC_POLARITY 0x0008 992 | // @} 993 | 994 | ///\defgroup define_modetiming_standard Timing Standards 995 | /// Defines for ADLDisplayModeInfo.iTimingStandard field 996 | // @{ 997 | #define ADL_DL_MODETIMING_STANDARD_CVT 0x00000001 // CVT Standard 998 | #define ADL_DL_MODETIMING_STANDARD_GTF 0x00000002 // GFT Standard 999 | #define ADL_DL_MODETIMING_STANDARD_DMT 0x00000004 // DMT Standard 1000 | #define ADL_DL_MODETIMING_STANDARD_CUSTOM 0x00000008 // User-defined standard 1001 | #define ADL_DL_MODETIMING_STANDARD_DRIVER_DEFAULT 0x00000010 // Remove Mode from overriden list 1002 | // @} 1003 | 1004 | // \defgroup define_xserverinfo driver x-server info 1005 | /// These flags are used by ADL_XServerInfo_Get() 1006 | // @ 1007 | 1008 | /// Xinerama is active in the x-server, Xinerama extension may report it to be active but it 1009 | /// may not be active in x-server 1010 | #define ADL_XSERVERINFO_XINERAMAACTIVE (1<<0) 1011 | 1012 | /// RandR 1.2 is supported by driver, RandR extension may report version 1.2 1013 | /// but driver may not support it 1014 | #define ADL_XSERVERINFO_RANDR12SUPPORTED (1<<1) 1015 | // @ 1016 | 1017 | 1018 | ///\defgroup define_eyefinity_constants Eyefinity Definitions 1019 | // @{ 1020 | 1021 | #define ADL_CONTROLLERVECTOR_0 1 // ADL_CONTROLLERINDEX_0 = 0, (1 << ADL_CONTROLLERINDEX_0) 1022 | #define ADL_CONTROLLERVECTOR_1 2 // ADL_CONTROLLERINDEX_1 = 1, (1 << ADL_CONTROLLERINDEX_1) 1023 | 1024 | #define ADL_DISPLAY_SLSGRID_ORIENTATION_000 0x00000001 1025 | #define ADL_DISPLAY_SLSGRID_ORIENTATION_090 0x00000002 1026 | #define ADL_DISPLAY_SLSGRID_ORIENTATION_180 0x00000004 1027 | #define ADL_DISPLAY_SLSGRID_ORIENTATION_270 0x00000008 1028 | #define ADL_DISPLAY_SLSGRID_CAP_OPTION_RELATIVETO_LANDSCAPE 0x00000001 1029 | #define ADL_DISPLAY_SLSGRID_CAP_OPTION_RELATIVETO_CURRENTANGLE 0x00000002 1030 | #define ADL_DISPLAY_SLSGRID_PORTAIT_MODE 0x00000004 1031 | 1032 | 1033 | #define ADL_DISPLAY_SLSMAPCONFIG_GET_OPTION_RELATIVETO_LANDSCAPE 0x00000001 1034 | #define ADL_DISPLAY_SLSMAPCONFIG_GET_OPTION_RELATIVETO_CURRENTANGLE 0x00000002 1035 | 1036 | #define ADL_DISPLAY_SLSMAPCONFIG_CREATE_OPTION_RELATIVETO_LANDSCAPE 0x00000001 1037 | #define ADL_DISPLAY_SLSMAPCONFIG_CREATE_OPTION_RELATIVETO_CURRENTANGLE 0x00000002 1038 | 1039 | #define ADL_DISPLAY_SLSMAPCONFIG_REARRANGE_OPTION_RELATIVETO_LANDSCAPE 0x00000001 1040 | #define ADL_DISPLAY_SLSMAPCONFIG_REARRANGE_OPTION_RELATIVETO_CURRENTANGLE 0x00000002 1041 | 1042 | 1043 | #define ADL_DISPLAY_SLSGRID_RELATIVETO_LANDSCAPE 0x00000010 1044 | #define ADL_DISPLAY_SLSGRID_RELATIVETO_CURRENTANGLE 0x00000020 1045 | 1046 | 1047 | /// The bit mask identifies displays is currently in bezel mode. 1048 | #define ADL_DISPLAY_SLSMAP_BEZELMODE 0x00000010 1049 | /// The bit mask identifies displays from this map is arranged. 1050 | #define ADL_DISPLAY_SLSMAP_DISPLAYARRANGED 0x00000002 1051 | /// The bit mask identifies this map is currently in used for the current adapter. 1052 | #define ADL_DISPLAY_SLSMAP_CURRENTCONFIG 0x00000004 1053 | 1054 | ///For onlay active SLS map info 1055 | #define ADL_DISPLAY_SLSMAPINDEXLIST_OPTION_ACTIVE 0x00000001 1056 | 1057 | ///For Bezel 1058 | #define ADL_DISPLAY_BEZELOFFSET_STEPBYSTEPSET 0x00000004 1059 | #define ADL_DISPLAY_BEZELOFFSET_COMMIT 0x00000008 1060 | 1061 | // @} 1062 | 1063 | // @} 1064 | #endif /* ADL_DEFINES_H_ */ 1065 | 1066 | 1067 | --------------------------------------------------------------------------------