- implement backend switcher for Windows. NYD: Still needs to be done for Mac and Linux

This commit is contained in:
Rachael Alexanderson 2019-03-11 23:36:44 -04:00
parent 879aae1bd3
commit 6be5769746

View file

@ -51,6 +51,15 @@
EXTERN_CVAR(Int, vid_maxfps)
CUSTOM_CVAR(Int, vid_backend, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
{
// [SP] This may seem pointless - but I don't want to implement live switching just
// yet - I'm pretty sure it's going to require a lot of reinits and destructions to
// do it right without memory leaks
Printf("Changing the video backend requires a restart for " GAMENAME ".\n");
}
extern HWND Window;
IVideo *Video;
@ -127,7 +136,7 @@ void I_InitGraphics ()
// are the active app. Huh?
}
// if (vid_backend == 0)
if (vid_backend == 0)
{
// first try Vulkan, if that fails OpenGL
try
@ -139,10 +148,10 @@ void I_InitGraphics ()
Video = new Win32GLVideo();
}
}
/*else
else
{
Video = new Win32GLVideo();
}*/
}
if (Video == NULL)
I_FatalError ("Failed to initialize display");