Ejemplo n.º 1
0
 private static void SetupRendering()
 {
     try
     {
         _dxManager     = new D3DManager(RenderForm);
         _modelRenderer = new ModelRenderer(_dxManager.Device, new Model(Models.First()));
         _modelRenderer.RenderParameters.Camera.Aspect = (float)RenderForm.ClientSize.Width / RenderForm.ClientSize.Height;
     }
     catch (Direct3D11Exception direct3D11Exception)
     {
         MessageBox.Show(RenderForm, "Error setting up D3D. \nMessage: '" + direct3D11Exception.Message + "'.");
         Environment.Exit(1);
     }
     catch (InvalidOperationException invalidOperationException)
     {
         MessageBox.Show(RenderForm, "No models found in the 'Models' directory.");
         Environment.Exit(1);
     }
     catch (FileNotFoundException fileNotFoundException)
     {
         MessageBox.Show(RenderForm, "Either no shader named 'Tessellation.hlsl' in the Shaders folder, or no texture named 'Texture.dds' in the Textures directory was found.");
         Environment.Exit(1);
     }
     catch (FileLoadException fileLoadException)
     {
         MessageBox.Show(RenderForm, "Error loading the model. \nMessage: '" + fileLoadException.Message + "'.");
         Environment.Exit(1);
     }
     catch (CompilationException compilationException)
     {
         MessageBox.Show(RenderForm, "Error compiling the shaders. \nMessage: '" + compilationException.Message + "'.");
         Environment.Exit(1);
     }
 }
Ejemplo n.º 2
0
 private static void SetupRendering()
 {
     try
     {
         _dxManager = new D3DManager(RenderForm);
         _modelRenderer = new ModelRenderer(_dxManager.Device, new Model(Models.First()));
         _modelRenderer.RenderParameters.Camera.Aspect = (float)RenderForm.ClientSize.Width / RenderForm.ClientSize.Height;
     }
     catch (Direct3D11Exception direct3D11Exception)
     {
         MessageBox.Show(RenderForm, "Error setting up D3D. \nMessage: '" + direct3D11Exception.Message + "'.");
         Environment.Exit(1);
     }
     catch (InvalidOperationException invalidOperationException)
     {
         MessageBox.Show(RenderForm, "No models found in the 'Models' directory.");
         Environment.Exit(1);
     }
     catch (FileNotFoundException fileNotFoundException)
     {
         MessageBox.Show(RenderForm, "Either no shader named 'Tessellation.hlsl' in the Shaders folder, or no texture named 'Texture.dds' in the Textures directory was found.");
         Environment.Exit(1);
     }
     catch (FileLoadException fileLoadException)
     {
         MessageBox.Show(RenderForm, "Error loading the model. \nMessage: '" + fileLoadException.Message + "'.");
         Environment.Exit(1);
     }
     catch (CompilationException compilationException)
     {
         MessageBox.Show(RenderForm, "Error compiling the shaders. \nMessage: '" + compilationException.Message + "'.");
         Environment.Exit(1);
     }
 }