diff --git a/source-code/source/plugins/Render/dllmain.cpp b/source-code/source/plugins/Render/dllmain.cpp index 0c9f3b1..256ab14 100644 --- a/source-code/source/plugins/Render/dllmain.cpp +++ b/source-code/source/plugins/Render/dllmain.cpp @@ -10,9 +10,6 @@ int hookedCreateWindow(const char* title, void(__cdecl* exit_function)(int)) { // trick Optimus into switching to the NVIDIA GPU - HMODULE nvcudaModule = LoadLibraryW(L"nvcuda.dll"); - // cuInit actually returns a CUresult, but we don't really care about it - void(WINAPI * cuInit)(unsigned int flags) = (void(WINAPI*)(unsigned int flags))GetProcAddress(nvcudaModule, "cuInit"); if (cuInit != NULL) cuInit(0); if (nDisplay == 2) // fullscreen diff --git a/source-code/source/plugins/Render/framework.h b/source-code/source/plugins/Render/framework.h index 42237fd..d870bed 100644 --- a/source-code/source/plugins/Render/framework.h +++ b/source-code/source/plugins/Render/framework.h @@ -34,3 +34,7 @@ int nIntResHeight = GetPrivateProfileIntW(L"resolution", L"r.height", 720, CONFI int nBitDepth = GetPrivateProfileIntW(L"resolution", L"bitdepth", 32, CONFIG_FILE); int nRefreshRate = GetPrivateProfileIntW(L"resolution", L"refreshrate", 60, CONFIG_FILE); +// used to trick Optimus into switching to the NVIDIA GPU +HMODULE nvcudaModule = LoadLibraryW(L"nvcuda.dll"); +// cuInit actually returns a CUresult, but we don't really care about it +void(WINAPI * cuInit)(unsigned int flags) = (void(WINAPI*)(unsigned int flags))GetProcAddress(nvcudaModule, "cuInit");