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:
somewhatlurker
2019-08-05 08:07:23 +10:00
parent fe2828a730
commit f8eefbf6bc
3 changed files with 25 additions and 22 deletions
@@ -9,13 +9,6 @@ using namespace System::Windows::Forms;
[STAThread]
int showUI() {
SetProcessDPIAware();
// 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);
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Application::Run(gcnew Launcher::ui());