Esempio n. 1
0
        /// <summary>
        /// Initialize our effects! Try to create all of them, if successful,
        ///  they will be added to a list of valid effects, which can be used later.
        /// </summary>
        protected void InitEffects()
        {
            //
            // World Rendering
            //
            // Attempt to get our TestEffect...
            try
            {
                RenderEffects.Add(new Effects.TestEffect.TestEffect(Device));
            }
            catch (Effects.EffectBuildException buildException)
            {
                MessageBox.Show("Could not build TestEffect!\n" + buildException.Message, WindowCaption);
            }

            // Attempt to get our BasicEffect...
            try
            {
                RenderEffects.Add(new Effects.BasicEffect.BasicEffect(Device));
            }
            catch (Effects.EffectBuildException buildException)
            {
                MessageBox.Show("Could not build BasicEffect!\n" + buildException.Message, WindowCaption);
            }

            //
            // Specialized Rendering
            //
            // Attempt to get MenuEffect...
            try
            {
                MenuRenderEffect = new Effects.MenuEffect.MenuEffect(Device);
            }
            catch (Effects.EffectBuildException buildException)
            {
                MessageBox.Show("Could not build MenuEffect!\n" + buildException.Message, WindowCaption);
            }
        }
        /// <summary>
        /// Initialize our effects! Try to create all of them, if successful,
        ///  they will be added to a list of valid effects, which can be used later.
        /// </summary>
        protected void InitEffects()
        {
            //
            // World Rendering
            //
            // Attempt to get our TestEffect...
            try
            {
                RenderEffects.Add(new Effects.TestEffect.TestEffect(Device));
            }
            catch (Effects.EffectBuildException buildException)
            {
                MessageBox.Show("Could not build TestEffect!\n" + buildException.Message, WindowCaption);
            }

            // Attempt to get our BasicEffect...
            try
            {
                RenderEffects.Add(new Effects.BasicEffect.BasicEffect(Device));
            }
            catch (Effects.EffectBuildException buildException)
            {
                MessageBox.Show("Could not build BasicEffect!\n" + buildException.Message, WindowCaption);
            }

            //
            // Specialized Rendering
            //
            // Attempt to get MenuEffect...
            try
            {
                MenuRenderEffect = new Effects.MenuEffect.MenuEffect(Device);
            }
            catch (Effects.EffectBuildException buildException)
            {
                MessageBox.Show("Could not build MenuEffect!\n" + buildException.Message, WindowCaption);
            }
        }