Merge branch 'release-0.1' of https://github.com/Vocaluxe/Vocaluxe into release-0.1

This commit is contained in:
Alexander Eckart committed 2012-03-21 21:10:32 +01:00
commit 1385c30fee
1 file changed
+22 -9
+22 -9
View File
@@ -71,12 +71,14 @@ namespace Vocaluxe.Lib.Draw
_VerticesRotationMatrices = new Queue<Matrix>(); _VerticesRotationMatrices = new Queue<Matrix>();
_Keys = new CKeys(); _Keys = new CKeys();
_D3D = new Direct3D(); try
{
if (_D3D == null) _D3D = new Direct3D();
}
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");
CLog.LogError("No DirectX runtimes were found, please download and install them from http://www.microsoft.com/download/en/details.aspx?id=8109"); 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); Environment.Exit(Environment.ExitCode);
} }
@@ -172,14 +174,25 @@ namespace Vocaluxe.Lib.Draw
flags = CreateFlags.HardwareVertexProcessing; flags = CreateFlags.HardwareVertexProcessing;
else else
flags = CreateFlags.SoftwareVertexProcessing; flags = CreateFlags.SoftwareVertexProcessing;
_Device = new Device(_D3D, _D3D.Adapters.DefaultAdapter.Adapter, DeviceType.Hardware, Handle, flags, _PresentParameters); try
if (_Device.Disposed || _D3D.Disposed || _Device == null || _D3D == null)
{ {
MessageBox.Show("Something went wrong with 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"); _Device = new Device(_D3D, _D3D.Adapters.DefaultAdapter.Adapter, DeviceType.Hardware, Handle, flags, _PresentParameters);
CLog.LogError("Something went wrong with 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"); }
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");
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); Environment.Exit(Environment.ExitCode);
} }
finally
{
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");
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);
}
}
this.CenterToScreen(); this.CenterToScreen();
} }