Example #1
0
        /// <summary>
        /// Inicio todos los objetos necesarios para cargar el ejemplo y directx
        /// </summary>
        public void InitGraphics()
        {
            //Se inicio la aplicacion
            ApplicationRunning = true;

            //Inicio Device
            D3DDevice.Instance.InitializeD3DDevice(panel3D);

            //Inicio inputs
            Input = new TgcD3dInput();
            Input.Initialize(this, panel3D);

            //Inicio sonido
            DirectSound = new TgcDirectSound();
            DirectSound.InitializeD3DDevice(panel3D);

            //Directorio actual de ejecucion
            var currentDirectory = Environment.CurrentDirectory + "\\";

            //Cargar shaders del framework
            TgcShaders.Instance.loadCommonShaders(currentDirectory + Game.Default.ShadersDirectory);

            //Juego a ejecutar
            Modelo = new Juego(currentDirectory + Game.Default.MediaDirectory, currentDirectory + Game.Default.ShadersDirectory);

            //Cargar juego
            ExecuteModel();
        }
Example #2
0
        /// <summary>
        ///     Inicio todos los objetos necesarios para cargar el ejemplo y directx.
        /// </summary>
        public void InitGraphics()
        {
            //Se inicio la aplicación
            ApplicationRunning = true;

            //Inicio Device
            D3DDevice.Instance.InitializeD3DDevice(panel3D);

            //Inicio inputs
            Input = new TgcD3dInput();
            Input.Initialize(this, panel3D);

            //Inicio sonido
            DirectSound = new TgcDirectSound();
            DirectSound.InitializeD3DDevice(panel3D);

            //Directorio actual de ejecución
            var currentDirectory = Environment.CurrentDirectory + "\\";

            //Cargar shaders del framework
            TgcShaders.Instance.loadCommonShaders(currentDirectory + Game.Default.ShadersDirectory);

            //Juego a ejecutar, si quisiéramos tener diferentes modelos aquí podemos cambiar la instancia e invocar a otra clase.
            Modelo = new GameModel(currentDirectory + Game.Default.MediaDirectory,
                                   currentDirectory + Game.Default.ShadersDirectory);

            //Cargar juego.
            ExecuteModel();
        }
Example #3
0
        /// <summary>
        ///     Inicio todos los objetos necesarios para cargar el ejemplo y directx.
        /// </summary>
        public void InitGraphics()
        {
            Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().ToString());
            // Se inicio la aplicación
            ApplicationRunning = true;

            // Inicio Device
            D3DDevice.Instance.InitializeD3DDevice(panel3D);

            // Inicio inputs
            Input = new TgcD3dInput();
            Input.Initialize(this, panel3D);

            // Inicio sonido
            DirectSound = new TgcDirectSound();
            DirectSound.InitializeD3DDevice(panel3D);

            // Directorio actual de ejecución
            currentDirectory = Environment.CurrentDirectory;
            currentDirectory = currentDirectory.Substring(0, currentDirectory.LastIndexOf('\\'));
            currentDirectory = currentDirectory.Substring(0, currentDirectory.LastIndexOf('\\')) + "\\";
            //independiente de build. Medio garca pero no encontre una forma estandar de hacerlo

            // Cargar shaders del framework
            TGCShaders.Instance.LoadCommonShaders(currentDirectory + Game.Default.ShadersDirectory, D3DDevice.Instance);

            // Juego a ejecutar, si quisiéramos tener diferentes modelos aquí podemos cambiar la instancia e invocar a otra clase.
            Modelo = new GameModel(currentDirectory + Game.Default.MediaDirectory, currentDirectory + Game.Default.ShadersDirectory);

            // Cargar juego.
            ExecuteModel();
        }
Example #4
0
        /// <summary>
        /// Inicia el device basado en el panel, el sonido, los inputs y carga los shaders basicos.
        /// </summary>
        /// <param name="form"> Ventana que contiene la aplicacion.</param>
        /// <param name="control"> Control donde van a correr los ejemplos.</param>
        /// <param name="pathCommonShaders"> Ruta con los shaders basicos.</param>
        public void InitGraphics(ToolsForm form, Panel control)
        {
            ApplicationRunning = true;
            Form    = form;
            Panel3d = control;

            //Inicio Device
            D3DDevice.Instance.InitializeD3DDevice(control);
            D3DDevice.Instance.Device.DeviceReset += OnResetDevice;

            //Inicio inputs
            Input = new TgcD3dInput();
            Input.Initialize(Form, control);

            //Inicio sonido
            DirectSound = new TgcDirectSound();
            try
            {
                DirectSound.InitializeD3DDevice(control);
            }
            catch (ApplicationException ex)
            {
                throw new Exception("No se pudo inicializar el sonido", ex);
            }
        }
Example #5
0
        /// <summary>
        ///     Inicio todos los objetos necesarios para cargar el ejemplo y directx.
        /// </summary>
        public void InitGraphics()
        {
            ApplicationRunning = true;
            D3DDevice.Instance.InitializeD3DDevice(panel3D);

            //Inicio inputs
            Input = new TgcD3dInput();
            Input.Initialize(this, panel3D);

            //Inicio sonido
            DirectSound = new TgcDirectSound();
            try
            {
                DirectSound.InitializeD3DDevice(panel3D);
            }
            catch (ApplicationException ex)
            {
                throw new Exception("No se pudo inicializar el sonido", ex);
            }

            //Directorio actual de ejecución
            var currentDirectory = Environment.CurrentDirectory + "\\";

            //Cargar shaders del framework
            TGCShaders.Instance.LoadCommonShaders(currentDirectory + Game.Default.ShadersDirectory, D3DDevice.Instance);

            Modelo = new GameModel(currentDirectory + Game.Default.MediaDirectory,
                                   currentDirectory + Game.Default.ShadersDirectory);

            ExecuteModel();
        }
Example #6
0
        public void InitGraphics(ViewerForm form, TreeView treeViewExamples, Panel panel3D,
                                 ToolStripStatusLabel toolStripStatusCurrentExample)
        {
            ApplicationRunning = true;

            Form = form;

            //Inicio Device
            D3DDevice.Instance.InitializeD3DDevice(panel3D);
            D3DDevice.Instance.Device.DeviceReset += OnResetDevice;

            //Inicio inputs
            Input = new TgcD3dInput();
            Input.Initialize(Form, panel3D);

            //Inicio sonido
            DirectSound = new TgcDirectSound();
            DirectSound.InitializeD3DDevice(panel3D);

            //Directorio actual de ejecucion
            var currentDirectory = Environment.CurrentDirectory + "\\";

            //Cargar shaders del framework
            TgcShaders.Instance.loadCommonShaders(currentDirectory + Settings.Default.ShadersDirectory +
                                                  Settings.Default.CommonShaders);
        }
Example #7
0
        /// <summary>
        /// Inicia el device basado en el panel, el sonido, los inputs y carga los shaders basicos.
        /// </summary>
        /// <param name="form"> Ventana que contiene la aplicacion.</param>
        /// <param name="control"> Control donde van a correr los ejemplos.</param>
        /// <param name="pathCommonShaders"> Ruta con los shaders basicos.</param>
        public void InitGraphics(ViewerForm form, Control control, string pathCommonShaders)
        {
            ApplicationRunning = true;
            Form = form;

            //Inicio Device
            D3DDevice.Instance.InitializeD3DDevice(control);
            D3DDevice.Instance.Device.DeviceReset += OnResetDevice;

            //Inicio inputs
            Input = new TgcD3dInput();
            Input.Initialize(Form, control);

            //Inicio sonido
            DirectSound = new TgcDirectSound();
            DirectSound.InitializeD3DDevice(control);

            //Cargar shaders del framework
            TGCShaders.Instance.LoadCommonShaders(pathCommonShaders, D3DDevice.Instance);
        }
        public void InitGraphics()
        {
            ApplicationRunning = true;

            D3DDevice.Instance.InitializeD3DDevice(panel3D);

            Input = new TgcD3dInput();
            Input.Initialize(this, panel3D);

            DirectSound = new TgcDirectSound();
            DirectSound.InitializeD3DDevice(panel3D);

            var currentDirectory = Environment.CurrentDirectory + "\\";

            //Cargar shaders del framework
            TgcShaders.Instance.loadCommonShaders(currentDirectory + Game.Default.ShadersDirectory);

            Modelo = new TwistedModel(currentDirectory + Game.Default.MediaDirectory,
                                      currentDirectory + Game.Default.ShadersDirectory);

            //Cargar juego.
            ExecuteModel();
        }