From 221e0700f768ce265bec2e6cef9a3b4033cd6388 Mon Sep 17 00:00:00 2001 From: binary1248 Date: Sat, 18 Apr 2015 21:29:55 +0200 Subject: [PATCH] Added NvOptimusEnablement and AmdPowerXpressRequestHighPerformance exports to sfml-main to inform the driver that the SFML application could benefit from using the discrete GPU in a multi-GPU environment. --- src/SFML/Main/MainWin32.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SFML/Main/MainWin32.cpp b/src/SFML/Main/MainWin32.cpp index c9f28736..29e7133f 100644 --- a/src/SFML/Main/MainWin32.cpp +++ b/src/SFML/Main/MainWin32.cpp @@ -41,6 +41,13 @@ #include +// Inform the Nvidia/AMD driver that this SFML application could +// benefit from using the more powerful discrete GPU +extern "C" +{ +__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; +__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; +} extern int main(int argc, char* argv[]);