Terminate Vocaluxe and show a message box if no DirectX runtime was found

This commit is contained in:
Stephan Sundermann committed 2012-03-21 15:56:10 +01:00
1 parent fd946dfcdb
commit b58087776c
1 file changed
+13 -2
+13 -2
View File
@@ -73,6 +73,13 @@ namespace Vocaluxe.Lib.Draw
_Keys = new CKeys(); _Keys = new CKeys();
_D3D = new Direct3D(); _D3D = new Direct3D();
if (_D3D == null)
{
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");
Environment.Exit(Environment.ExitCode);
}
this.Paint += new PaintEventHandler(this.OnPaintEvent); this.Paint += new PaintEventHandler(this.OnPaintEvent);
this.Closing += new CancelEventHandler(this.OnClosingEvent); this.Closing += new CancelEventHandler(this.OnClosingEvent);
this.Resize += new EventHandler(this.OnResizeEvent); this.Resize += new EventHandler(this.OnResizeEvent);
@@ -167,8 +174,12 @@ namespace Vocaluxe.Lib.Draw
flags = CreateFlags.SoftwareVertexProcessing; flags = CreateFlags.SoftwareVertexProcessing;
_Device = new Device(_D3D, _D3D.Adapters.DefaultAdapter.Adapter, DeviceType.Hardware, Handle, flags, _PresentParameters); _Device = new Device(_D3D, _D3D.Adapters.DefaultAdapter.Adapter, DeviceType.Hardware, Handle, flags, _PresentParameters);
if(_Device.Disposed || _D3D.Disposed || _Device == null || _D3D == null) if (_Device.Disposed || _D3D.Disposed || _Device == null || _D3D == null)
CLog.LogError("Something went wrong with device creating, please check if your DirectX redistributables and graficcard drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109"); {
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");
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");
Environment.Exit(Environment.ExitCode);
}
this.CenterToScreen(); this.CenterToScreen();
} }