mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-13 19:52:25 +00:00
Update FullScreenCanvas.cs
This commit is contained in:
parent
d61cfa6c06
commit
359f8ea974
1 changed files with 18 additions and 14 deletions
|
|
@ -18,7 +18,8 @@ namespace Cosmos.System.Graphics
|
|||
private static bool SVGAIIExists = SVGAIIDevice.DeviceExists;
|
||||
|
||||
private static VideoDriver videoDevice;
|
||||
|
||||
|
||||
// Created null - NullReferenceException when calling GetFullScreenCanvas() with 0 overloads
|
||||
private static Canvas MyVideoDriver = null;
|
||||
|
||||
public static Canvas GetFullScreenCanvas(Mode mode)
|
||||
|
|
@ -30,20 +31,23 @@ namespace Cosmos.System.Graphics
|
|||
videoDevice = VideoDriver.VMWareSVGAIIDriver;
|
||||
|
||||
// If there's no instance of a video driver created (which there isn't), create it:
|
||||
if (MyVideoDriver == null) {
|
||||
|
||||
// If running on VMWare and using SVGAII, then use that driver:
|
||||
if (videoDevice == VideoDriver.VMWareSVGAIIDriver)
|
||||
// Creates the instance
|
||||
return MyVideoDriver = new SVGAIIScreen(mode);
|
||||
// If not running on VMWare, then use the VESA BIOS Extensions:
|
||||
else if (videoDevice == VideoDriver.VBEDriver)
|
||||
// Creates the instance
|
||||
return MyVideoDriver = new VBEScreen(mode);
|
||||
}
|
||||
|
||||
if (MyVideoDriver == null)
|
||||
{
|
||||
// If running on VMWare and using SVGAII, then use that driver:
|
||||
if (videoDevice == VideoDriver.VMWareSVGAIIDriver)
|
||||
{
|
||||
// Creates the instance
|
||||
return MyVideoDriver = new SVGAIIScreen(mode);
|
||||
}
|
||||
// If not running on VMWare, then use the VESA BIOS Extensions:
|
||||
else if (videoDevice == VideoDriver.VBEDriver)
|
||||
{
|
||||
// Creates the instance
|
||||
return MyVideoDriver = new VBEScreen(mode);
|
||||
}
|
||||
}
|
||||
|
||||
/* We have already got a VideoDriver istance simple change its mode */
|
||||
/* We have already got a VideoDriver instance, simply change its mode */
|
||||
MyVideoDriver.Mode = mode;
|
||||
return MyVideoDriver;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue