Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:58:15

0001 ////////////////////////////////////////////////////////////
0002 //
0003 // SFML - Simple and Fast Multimedia Library
0004 // Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
0005 //
0006 // This software is provided 'as-is', without any express or implied warranty.
0007 // In no event will the authors be held liable for any damages arising from the use of this software.
0008 //
0009 // Permission is granted to anyone to use this software for any purpose,
0010 // including commercial applications, and to alter it and redistribute it freely,
0011 // subject to the following restrictions:
0012 //
0013 // 1. The origin of this software must not be misrepresented;
0014 //    you must not claim that you wrote the original software.
0015 //    If you use this software in a product, an acknowledgment
0016 //    in the product documentation would be appreciated but is not required.
0017 //
0018 // 2. Altered source versions must be plainly marked as such,
0019 //    and must not be misrepresented as being the original software.
0020 //
0021 // 3. This notice may not be removed or altered from any source distribution.
0022 //
0023 ////////////////////////////////////////////////////////////
0024 
0025 #ifndef SFML_GPUPREFERENCE_HPP
0026 #define SFML_GPUPREFERENCE_HPP
0027 
0028 
0029 ////////////////////////////////////////////////////////////
0030 /// Headers
0031 ////////////////////////////////////////////////////////////
0032 #include <SFML/Config.hpp>
0033 
0034 
0035 ////////////////////////////////////////////////////////////
0036 /// \file
0037 ///
0038 /// \brief File containing SFML_DEFINE_DISCRETE_GPU_PREFERENCE
0039 ///
0040 ////////////////////////////////////////////////////////////
0041 
0042 
0043 ////////////////////////////////////////////////////////////
0044 /// \def SFML_DEFINE_DISCRETE_GPU_PREFERENCE
0045 ///
0046 /// \brief A macro to encourage usage of the discrete GPU
0047 ///
0048 /// In order to inform the Nvidia/AMD driver that an SFML
0049 /// application could benefit from using the more powerful
0050 /// discrete GPU, special symbols have to be publicly
0051 /// exported from the final executable.
0052 ///
0053 /// SFML defines a helper macro to easily do this.
0054 ///
0055 /// Place SFML_DEFINE_DISCRETE_GPU_PREFERENCE in the
0056 /// global scope of a source file that will be linked into
0057 /// the final executable. Typically it is best to place it
0058 /// where the main function is also defined.
0059 ///
0060 ////////////////////////////////////////////////////////////
0061 #if defined(SFML_SYSTEM_WINDOWS)
0062 
0063     #define SFML_DEFINE_DISCRETE_GPU_PREFERENCE \
0064                 extern "C" __declspec(dllexport) unsigned long NvOptimusEnablement = 1; \
0065                 extern "C" __declspec(dllexport) unsigned long AmdPowerXpressRequestHighPerformance = 1;
0066 
0067 #else
0068 
0069     #define SFML_DEFINE_DISCRETE_GPU_PREFERENCE
0070 
0071 #endif
0072 
0073 
0074 #endif // SFML_GPUPREFERENCE_HPP