From 55d5720962fae2b74bcaa0453c3cbd8c686a64fd Mon Sep 17 00:00:00 2001
From: BreadFish64 <mohror64@gmail.com>
Date: Thu, 15 Mar 2018 20:36:53 -0500
Subject: [PATCH 1/2] use nvidia graphics automatically on laptops with optimus

---
 src/citra/citra.cpp   | 6 ++++++
 src/citra_qt/main.cpp | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index c98cbb33e..2c9d58646 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -40,6 +40,12 @@
 #include "core/settings.h"
 #include "network/network.h"
 
+#ifdef _WIN32
+extern "C" {
+__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
+}
+#endif
+
 static void PrintHelp(const char* argv0) {
     std::cout << "Usage: " << argv0
               << " [options] <filename>\n"
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 2c54c1539..8b251994f 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -54,6 +54,12 @@
 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
 #endif
 
+#ifdef _WIN32
+extern "C" {
+__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

From 691aadb6a3770c6ac57fe59e3274b59e2af22505 Mon Sep 17 00:00:00 2001
From: BreadFish64 <mohror64@gmail.com>
Date: Fri, 16 Mar 2018 16:06:33 -0500
Subject: [PATCH 2/2] comment

---
 src/citra/citra.cpp   | 1 +
 src/citra_qt/main.cpp | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index 2c9d58646..5635b6ddd 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -42,6 +42,7 @@
 
 #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
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 8b251994f..1c5047963 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -56,6 +56,7 @@ Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin);
 
 #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