launcher: avoid crashing with original version of GLUT, move cuInit call into ui.h (function setup in framework.h), allow changing resolution of borderless mode
This commit is contained in:
@@ -257,4 +257,14 @@ void PrependFile(LPCSTR newStr, LPCWSTR fileName)
|
||||
fileStream.seekg(0, std::ios::beg);
|
||||
fileStream << outStr;
|
||||
fileStream.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 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");
|
||||
|
||||
// needed to close the OpenGL window (freeglut only)
|
||||
HMODULE glutModule = LoadLibraryW(L"glut32.dll");
|
||||
void(__stdcall * glutMainLoopEventDynamic)() = (void(__stdcall*)())GetProcAddress(glutModule, "glutMainLoopEventDynamic");
|
||||
Reference in New Issue
Block a user