- attempt to fix "DXGI_ERROR_NOT_CURRENTLY_AVAILABLE" exceptions (the game tries forcing focus to the window and running GameMain again, and if that doesn't help, disables hardware mode switching)
- messages can be added to debugconsole before it's initialized
This commit is contained in:
@@ -103,7 +103,7 @@ namespace Barotrauma
|
||||
{
|
||||
get { return NetworkMember as GameClient; }
|
||||
}
|
||||
|
||||
|
||||
public GameMain()
|
||||
{
|
||||
Graphics = new GraphicsDeviceManager(this);
|
||||
@@ -119,21 +119,11 @@ namespace Barotrauma
|
||||
Config.WasGameUpdated = false;
|
||||
Config.Save("config.xml");
|
||||
}
|
||||
|
||||
graphicsWidth = Config.GraphicsWidth;
|
||||
graphicsHeight = Config.GraphicsHeight;
|
||||
Graphics.SynchronizeWithVerticalRetrace = Config.VSyncEnabled;
|
||||
|
||||
Graphics.HardwareModeSwitch = Config.WindowMode != WindowMode.BorderlessWindowed;
|
||||
ApplyGraphicsSettings();
|
||||
|
||||
Graphics.IsFullScreen = Config.WindowMode == WindowMode.Fullscreen || Config.WindowMode == WindowMode.BorderlessWindowed;
|
||||
Graphics.PreferredBackBufferWidth = graphicsWidth;
|
||||
Graphics.PreferredBackBufferHeight = graphicsHeight;
|
||||
Content.RootDirectory = "Content";
|
||||
|
||||
//graphics.SynchronizeWithVerticalRetrace = false;
|
||||
//graphics.ApplyChanges();
|
||||
|
||||
FrameCounter = new FrameCounter();
|
||||
|
||||
//IsMouseVisible = true;
|
||||
@@ -150,6 +140,20 @@ namespace Barotrauma
|
||||
FarseerPhysics.Settings.VelocityIterations = 1;
|
||||
FarseerPhysics.Settings.PositionIterations = 1;
|
||||
|
||||
}
|
||||
|
||||
public void ApplyGraphicsSettings()
|
||||
{
|
||||
graphicsWidth = Config.GraphicsWidth;
|
||||
graphicsHeight = Config.GraphicsHeight;
|
||||
Graphics.SynchronizeWithVerticalRetrace = Config.VSyncEnabled;
|
||||
|
||||
Graphics.HardwareModeSwitch = Config.WindowMode != WindowMode.BorderlessWindowed;
|
||||
|
||||
Graphics.IsFullScreen = Config.WindowMode == WindowMode.Fullscreen || Config.WindowMode == WindowMode.BorderlessWindowed;
|
||||
Graphics.PreferredBackBufferWidth = graphicsWidth;
|
||||
Graphics.PreferredBackBufferHeight = graphicsHeight;
|
||||
|
||||
Graphics.ApplyChanges();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user