|
@@ -30,6 +30,11 @@ Type TSystemDriver
|
|
|
|
|
|
End Type
|
|
|
|
|
|
+Interface IWrappedSystemDriver
|
|
|
+ Method SetDriver(driver:TSystemDriver)
|
|
|
+ Method GetDriver:TSystemDriver()
|
|
|
+End Interface
|
|
|
+
|
|
|
Private
|
|
|
Global _Driver:TSystemDriver
|
|
|
Public
|
|
@@ -39,7 +44,13 @@ bbdoc: Initialises the BlitzMax system driver.
|
|
|
about: There can only be one system driver initialised. A second call to this function will result in an exception.
|
|
|
End Rem
|
|
|
Function InitSystemDriver(driver:TSystemDriver)
|
|
|
- If _Driver Throw "Cannot initialise " + driver.ToString() + ". System driver already configured as " + _Driver.ToString()
|
|
|
+ If _Driver Then
|
|
|
+ If IWrappedSystemDriver(driver) Then
|
|
|
+ IWrappedSystemDriver(driver).SetDriver(_Driver)
|
|
|
+ Else
|
|
|
+ Throw "Cannot initialise " + driver.ToString() + ". System driver already configured as " + _Driver.ToString()
|
|
|
+ End If
|
|
|
+ End If
|
|
|
_Driver = driver
|
|
|
End Function
|
|
|
|