1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Allow unloading video drivers.

This commit is contained in:
Jonas 'Sortie' Termansen 2012-12-05 19:25:15 +01:00
parent 6037babcbf
commit 754a10e274

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; }