Allow unloading video drivers.

This commit is contained in:
Jonas 'Sortie' Termansen 2012-12-05 19:25:15 +01:00
parent 6037babcbf
commit 754a10e274
1 changed files with 9 additions and 0 deletions

View File

@ -386,6 +386,15 @@ bool SwitchMode(const char* mode)
UpdateModes();
char* drivername = NULL;
if ( !ReadParamString(mode, "driver", &drivername, NULL) ) { return false; }
if ( !strcmp(drivername, "none") )
{
DriverEntry* driverentry = CurrentDriverEntry();
if ( !driverentry )
return true;
ShutDownDriver(driverentry->driver, driverentry->name);
currentdrvid = SIZE_MAX;
return true;
}
DriverEntry* drvent = GetDriverEntry(drivername);
delete[] drivername;
if ( !drvent ) { return false; }