mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-18 05:42:12 +08:00
Editing points and portals in navmesh, improved DX error message
This commit is contained in:
@@ -71,6 +71,7 @@ namespace CodeWalker.Rendering
|
||||
//#endif
|
||||
Device dev = null;
|
||||
SwapChain sc = null;
|
||||
Exception exc = null;
|
||||
|
||||
bool success = false;
|
||||
try
|
||||
@@ -78,7 +79,7 @@ namespace CodeWalker.Rendering
|
||||
Device.CreateWithSwapChain(DriverType.Hardware, flags, levels, scd, out dev, out sc);
|
||||
success = true;
|
||||
}
|
||||
catch { }
|
||||
catch(Exception ex) { exc = ex; }
|
||||
|
||||
if (!success)
|
||||
{
|
||||
@@ -90,12 +91,17 @@ namespace CodeWalker.Rendering
|
||||
Device.CreateWithSwapChain(DriverType.Hardware, flags, levels, scd, out dev, out sc);
|
||||
success = true;
|
||||
}
|
||||
catch { }
|
||||
catch (Exception ex) { exc = ex; }
|
||||
}
|
||||
|
||||
if (!success)
|
||||
{
|
||||
throw new Exception("CodeWalker was unable to initialise the graphics device. Please ensure your system meets the minimum requirements and that your graphics drivers and DirectX are up to date.");
|
||||
var msg = "CodeWalker was unable to initialise the graphics device. Please ensure your system meets the minimum requirements and that your graphics drivers and DirectX are up to date.";
|
||||
if (exc != null)
|
||||
{
|
||||
msg += "\n\nException info: " + exc.ToString();
|
||||
}
|
||||
throw new Exception(msg);
|
||||
}
|
||||
|
||||
device = dev;
|
||||
@@ -130,7 +136,7 @@ namespace CodeWalker.Rendering
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Unable to initialise DirectX11.\n" + ex.ToString());
|
||||
MessageBox.Show("Unable to initialise DirectX11.\n" + ex.Message, "CodeWalker - Error!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user