some additional try-catches for graphic inits

This commit is contained in:
Alexander Eckart committed 2012-03-22 09:50:02 +01:00
1 parent 83b7c37a1c
commit 227602483d
2 files changed
+34 -5

No files matched your search

+25 -2
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Vocaluxe.Base;
using Vocaluxe.Lib.Draw;
@@ -21,11 +22,33 @@ namespace Vocaluxe.Base
case ERenderer.TR_CONFIG_SOFTWARE:
_Draw = new CDrawWinForm();
break;
case ERenderer.TR_CONFIG_OPENGL:
_Draw = new COpenGL();
try
{
_Draw = new COpenGL();
}
catch (Exception e)
{
MessageBox.Show(e.Message + " - Error in initializing of OpenGL",
CSettings.sProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
CLog.LogError(e.Message + " - Error in initializing of OpenGL");
Environment.Exit(Environment.ExitCode);
}
break;
case ERenderer.TR_CONFIG_DIRECT3D:
_Draw = new CDirect3D();
try
{
_Draw = new CDirect3D();
}
catch (Exception e)
{
MessageBox.Show("No DirectX runtimes were found, please download and install them from http://www.microsoft.com/download/en/details.aspx?id=8109",
CSettings.sProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
CLog.LogError(e.Message + " - No DirectX runtimes were found, please download and install them from http://www.microsoft.com/download/en/details.aspx?id=8109");
Environment.Exit(Environment.ExitCode);
}
break;
default:
+9 -3
View File
@@ -77,7 +77,9 @@ namespace Vocaluxe.Lib.Draw
}
catch (Direct3D9NotFoundException e)
{
MessageBox.Show("No DirectX runtimes were found, please download and install them from http://www.microsoft.com/download/en/details.aspx?id=8109");
MessageBox.Show("No DirectX runtimes were found, please download and install them " +
"from http://www.microsoft.com/download/en/details.aspx?id=8109",
CSettings.sProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
CLog.LogError(e.Message + " - No DirectX runtimes were found, please download and install them from http://www.microsoft.com/download/en/details.aspx?id=8109");
Environment.Exit(Environment.ExitCode);
}
@@ -181,7 +183,9 @@ namespace Vocaluxe.Lib.Draw
}
catch (Exception e)
{
MessageBox.Show("Something went wrong during device creating, please check if your DirectX redistributables and grafic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109", "Vocaluxe", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("Something went wrong during device creating, please check if your DirectX redistributables " +
"and graphic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109",
CSettings.sProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
CLog.LogError(e.Message + " - Something went wrong during device creating, please check if your DirectX redistributables and grafic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109");
Environment.Exit(Environment.ExitCode);
}
@@ -189,7 +193,9 @@ namespace Vocaluxe.Lib.Draw
{
if (_Device == null || _Device.Disposed)
{
MessageBox.Show("Something went wrong during device creating, please check if your DirectX redistributables and grafic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109", "Vocaluxe", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show("Something went wrong during device creating, please check if your DirectX redistributables " +
"and graphic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109",
CSettings.sProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
CLog.LogError("Something went wrong during device creating, please check if your DirectX redistributables and grafic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109");
Environment.Exit(Environment.ExitCode);
}