Editing points and portals in navmesh, improved DX error message

This commit is contained in:
dexyfex
2018-03-14 12:36:43 +11:00
Unverified
parent 761278fd0b
commit 8b72fc1220
20 changed files with 2931 additions and 169 deletions
+10 -4
View File
@@ -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;
}
}