Explorar o código

Merge pull request #2210 from Azaezel/optimusPrimitive

switchable GPU Support
Areloch %!s(int64=7) %!d(string=hai) anos
pai
achega
2e5dfb4287
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      Engine/source/main/main.cpp

+ 10 - 0
Engine/source/main/main.cpp

@@ -283,6 +283,16 @@ int main(int argc, const char **argv)
 #include "app/mainLoop.h"
 #include "T3D/gameFunctions.h"
 
+#if defined(WIN32) || defined(_WIN32) 
+//tell switchable graphics supported systems that they need to use the beefier GPU
+#include <windows.h>
+extern "C" { __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; }
+extern "C" { __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001; }
+#else 
+extern "C" { int NvOptimusEnablement = 1; }
+extern "C" { int AmdPowerXpressRequestHighPerformance = 1; }
+#endif
+
 // Entry point for your game.
 //
 // This is build by default using the "StandardMainLoop" toolkit. Feel free