public bool Initialize(DSystemConfiguration consifguration, IntPtr windowsHandle) { try { // Create the Direct3D object. D3D = new DDX11(); // Initialize the Direct3D object. if (!D3D.Initialize(consifguration, windowsHandle)) { return(false); } // Create the Timer Timer = new DTimer(); // Initialize the Timer if (!Timer.Initialize()) { return(false); } return(true); } catch (Exception ex) { MessageBox.Show("Could not initialize Direct3D\nError is '" + ex.Message + "'"); return(false); } }
// Methods public bool Initialize(DSystemConfiguration configuration, IntPtr windowsHandle) { try { // Create the Direct3D object. D3D = new DDX11(); // Initialize the Direct3D object. if (!D3D.Initialize(configuration, windowsHandle)) { return(false); } // Create the Timer Timer = new DTimer(); // Initialize the Timer if (!Timer.Initialize()) { return(false); } // Create the camera object Camera = new DCamera(); // Set the initial position of the camera. Camera.SetPosition(0, 0, -10); // Create the model object. Model = new DModel(); // Initialize the model object. if (!Model.Initialize(D3D.Device, DSystemConfiguration.DataFilePath + "seafloor.bmp")) { MessageBox.Show("Could not initialize the model object."); return(false); } // Create the texture shader object. TextureShader = new DTextureShader(); // Initialize the texture shader object. if (!TextureShader.Initialize(D3D.Device, windowsHandle)) { MessageBox.Show("Could not initialize the texture shader object."); return(false); } return(true); } catch { return(false); } }
// Methods public bool Initialize(DSystemConfiguration configuration, IntPtr windowsHandle) { try { // Create the Direct3D object. D3D = new DDX11(); // Initialize the Direct3D object. if (!D3D.Initialize(configuration, windowsHandle)) { return(false); } // Create the Timer Timer = new DTimer(); // Initialize the Timer if (!Timer.Initialize()) { return(false); } // Create the camera object Camera = new DCamera(); // Set the initial position of the camera. moved closer inTutorial 7 Camera.SetPosition(0, 0, -10); // Create the texture shader object. TextureShader = new DTextureShader(); // Initialize the texture shader object. if (!TextureShader.Initialize(D3D.Device, windowsHandle)) { MessageBox.Show("Could not initialize the texture shader object."); return(false); } // Create the bitmap object. Bitmap = new DBitmap(); // Initialize the bitmap object. if (!Bitmap.Initialize(D3D.Device, configuration.Width, configuration.Height, "seafloor.bmp", 256, 256)) { return(false); } return(true); } catch (Exception ex) { MessageBox.Show("Could not initialize Direct3D\nError is '" + ex.Message + "'"); return(false); } }
// Mathods public bool Initialize(DSystemConfiguration configuration, IntPtr windowHandle) { try { // Create the Direct3D object. D3D = new DDX11(); // I nitialize the Direct3D object. if (!D3D.Initialize(configuration, windowHandle)) { return(false); } // Create the camera object Camera = new DCamera(); // Set the initial position of the camera. Camera.SetPosition(0, 0, -10); // Create the model object. Model = new DModel(); // Initialize the model object. if (!Model.Initialize(D3D.Device)) { return(false); } // Create the color shader object. ColorShader = new DColorShader(); // Initialize the color shader object. if (!ColorShader.Initialize(D3D.Device, windowHandle)) { return(false); } // Create the Timer Timer = new DTimer(); // Initialize the Timer if (!Timer.Initialize()) { return(false); } return(true); } catch (Exception ex) { MessageBox.Show("Could not initialize Direct3D\nError is '" + ex.Message + "'"); return(false); } }
public bool Initialize(DSystemConfiguration consifguration, IntPtr windowsHandle) { bool result = false; D3D = new DDX11(); result = D3D.Initialize(consifguration, windowsHandle); Timer = new DTimer(); result = Timer.Initialize(); return(result); }
public virtual void Initialize(string title, int width, int height, bool fullScreen, Surface surface) { if (Configuration == null) { Configuration = new DSystemConfiguration(title, width, height, fullScreen); } InitializeWindows(title); DApplication = new DApplication(); DApplication.Initialize(Configuration, RenderForm.Handle, surface); Timer = new DTimer(); Timer.Initialize(); }
// Methods. public bool Initialize(DSystemConfiguration configuration, IntPtr windowHandle) { try { // Create the Direct3D object. D3D = new DDX11(); // Initialize the Direct3D object. if (!D3D.Initialize(configuration, windowHandle)) { return(false); } // Create the Timer Timer = new DTimer(); // Initialize the Timer if (!Timer.Initialize()) { return(false); } // Create the camera object Camera = new DCamera(); // Initialize a base view matrix the camera for 2D user interface rendering. Camera.SetPosition(0, 0, -1); Camera.Render(); var baseViewMatrix = Camera.ViewMatrix; // Create the text object. Text = new DTextClass(); if (!Text.Initialize(D3D.Device, D3D.DeviceContext, windowHandle, configuration.Width, configuration.Height, baseViewMatrix)) { return(false); } Camera.SetPosition(0, 0, -10.0f); return(true); } catch (Exception ex) { MessageBox.Show("Could not initialize Direct3D\nError is '" + ex.Message + "'"); return(false); } }
public bool Initialize(DSystemConfiguration consifguration, IntPtr windowsHandle) { bool result = false; D3D = new DDX11(); result = D3D.Initialize(consifguration, windowsHandle); Timer = new DTimer(); result = Timer.Initialize(); Camera = new DCamera(); Camera.SetPosition(0, 0, -10); Model = new DModel(); result = Model.Initialize(D3D.Device, DSystemConfiguration.DataFilePath + "stone01.bmp"); TextureShader = new DTextureShader(); result = TextureShader.Initialize(D3D.Device, windowsHandle); return(result); }
public bool Initialize(DSystemConfiguration consifguration, IntPtr windowsHandle) { bool result = false; D3D = new DDX11(); result = D3D.Initialize(consifguration, windowsHandle); Camera = new DCamera(); Camera.SetPosition(0, 0, -10); Model = new DModel(); result = Model.Initialize(D3D.Device); ColorShader = new DColorShader(); result = ColorShader.Initialize(D3D.Device, windowsHandle); Timer = new DTimer(); result = Timer.Initialize(); return(result); }
// Methods public bool Initialize(DSystemConfiguration configuration, IntPtr windowsHandle) { try { // Create the Direct3D object. D3D = new DDX11(); // Initialize the Direct3D object. if (!D3D.Initialize(configuration, windowsHandle)) { return(false); } // Create the Timer Timer = new DTimer(); // Initialize the Timer if (!Timer.Initialize()) { return(false); } // Create the camera object Camera = new DCamera(); // Set the initial position of the camera. moved closer inTutorial 7 Camera.SetPosition(0, 0, -10.0f); // Create the model object. Model = new DModel(); // Initialize the model object. if (!Model.Initialize(D3D.Device, "Cube.txt", "seafloor.bmp")) { MessageBox.Show("Could not initialize the model object."); return(false); } // Create the texture shader object. LightShader = new DLightShader(); // Initialize the texture shader object. if (!LightShader.Initialize(D3D.Device, windowsHandle)) { MessageBox.Show("Could not initialize the texture shader object."); return(false); } // Create the light object. Light = new DLight(); // Iniialize the light object. Changed to white in Tutorial 7 Light.SetDiffuseColour(1, 1, 1, 1); Light.SetDirection(0, 0, 1); return(true); } catch (Exception ex) { MessageBox.Show("Could not initialize Direct3D\nError is '" + ex.Message + "'"); return(false); } }
// Methods public bool Initialize(DSystemConfiguration configuration, IntPtr windowsHandle) { try { // Create the Direct3D object. D3D = new DDX11(); // Initialize the Direct3D object. if (!D3D.Initialize(configuration, windowsHandle)) { return(false); } // Create the Timer Timer = new DTimer(); // Initialize the Timer if (!Timer.Initialize()) { return(false); } // Create the camera object Camera = new DCamera(); // Set the initial position of the camera. moved closer inTutorial 7 Camera.SetPosition(0, 0, -10.0f); // Create the model object. Model = new DModel(); // Initialize the model object. if (!Model.Initialize(D3D.Device, "Cube.txt", "seafloor.bmp")) { MessageBox.Show("Could not initialize the model object."); return(false); } // Create the texture shader object. LightShader = new DLightShader(); // Initialize the texture shader object. if (!LightShader.Initialize(D3D.Device, windowsHandle)) { MessageBox.Show("Could not initialize the texture shader object."); return(false); } // Create the light object. Light = new DLight(); // Iniialize the light object. Changed to white in Tutorial 7 // Added Setting of Ambiant Light to 15& brightness and adjust the Light direction along the X-Axis instead of the Z to see the ambient effect easier. Light.SetAmbientColor(0.15f, 0.15f, 0.15f, 1.0f); Light.SetDiffuseColour(1, 1, 1, 1); Light.SetDirection(1, 0, 0); return(true); } catch (Exception ex) { MessageBox.Show("Could not initialize Direct3D\nError is '" + ex.Message + "'"); return(false); } }
// Methods. public bool Initialize(DSystemConfiguration configuration, IntPtr windowHandle, string appTitle, int testTimeSeconds) { try { // Create the input object. Input = new DInput(); // Initialize the input object. if (!Input.Initialize(configuration, windowHandle)) { return(false); } #region Initialize System // Create the Direct3D object. D3D = new DDX11(); // Initialize the Direct3D object. if (!D3D.Initialize(configuration, windowHandle)) { return(false); } // Create the timer object. Timer = new DTimer(); // Initialize the timer object. if (!Timer.Initialize()) { return(false); } // Create the position object. Position = new DPosition(); // Set the initial position. Position.SetPosition(0.0f, 7.0f, -11.0f); Position.SetRotation(20.0f, 0.0f, 0.0f); #endregion #region Initialize Camera // Create the camera object Camera = new DCamera(); // Create the light object. Light = new DLight(); // Initialize the light object. Light.GenerateOrthoMatrix(15.0f, 15.0f, SHADOWMAP_DEPTH, SHADOWMAP_NEAR); #endregion // Create the ground model object. GroundModel = new DModel(); // Initialize the ground model object. if (!GroundModel.Initialize(D3D.Device, "plane01.txt", "dirt.bmp", 2.0f)) { return(false); } // Set the position for the ground model. GroundModel.SetPosition(0.0f, 1.0f, 0.0f); // Create the tree object. TreeModel = new DTreeModel(); // Initialize the shadow shader object. if (!TreeModel.Initialize(D3D.Device, "trunk001.txt", "trunk001.bmp", "leaf001.txt", "leaf001.bmp", 0.1f)) { return(false); } // Set the position for the tree model. TreeModel.SetPosition(0.0f, 1.0f, 0.0f); // Create the render to texture object. RenderTexture = new DRenderTexture(); // Initialize the render to texture object. if (!RenderTexture.Initialize(D3D.Device, SHADOWMAP_WIDTH, SHADOWMAP_HEIGHT, SHADOWMAP_DEPTH, SHADOWMAP_NEAR)) { return(false); } // Create the depth shader object. DepthShader = new DDepthShader(); // Initialize the depth shader object. if (!DepthShader.Initialize(D3D.Device, windowHandle)) { return(false); } // Create the transparent depth shader object. TransparentDepthShader = new DTransparentDepthShader(); // Initialize the transparent depth shader object. if (!TransparentDepthShader.Initialize(D3D.Device, windowHandle)) { return(false); } // Create the shadow shader object. ShadowShader = new DShadowShader(); // Initialize the shadow shader object. if (!ShadowShader.Initialize(D3D.Device, windowHandle)) { return(false); } DPerfLogger.Initialize("WinForms C# SharpDX: " + configuration.Width + "x" + configuration.Height + " VSync:" + DSystemConfiguration.VerticalSyncEnabled + " FullScreen:" + DSystemConfiguration.FullScreen + " " + appTitle, testTimeSeconds, configuration.Width, configuration.Height); return(true); } catch (Exception ex) { MessageBox.Show("Could not initialize Direct3D\nError is '" + ex.Message + "'"); return(false); } }