diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index c98cbb33e..5635b6ddd 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -40,6 +40,13 @@ #include "core/settings.h" #include "network/network.h" +#ifdef _WIN32 +extern "C" { +// tells Nvidia drivers to use the dedicated GPU by default on laptops with switchable graphics +__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; +} +#endif + static void PrintHelp(const char* argv0) { std::cout << "Usage: " << argv0 << " [options] \n" diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index b2951de11..96580ddd1 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -54,6 +54,13 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); #endif +#ifdef _WIN32 +extern "C" { +// tells Nvidia drivers to use the dedicated GPU by default on laptops with switchable graphics +__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001; +} +#endif + /** * "Callouts" are one-time instructional messages shown to the user. In the config settings, there * is a bitfield "callout_flags" options, used to track if a message has already been shown to the