コード例 #1
0
ファイル: Form1.cs プロジェクト: profexorgeek/FlatRedBall
        private void removePassButton_Click(object sender, EventArgs e)
        {
            EffectTechniqueDefinition technique = mEffectDefinition.Techniques[effectTechniquesList.SelectedIndex];

            technique.Passes.RemoveAt(effectTechniquePassesList.SelectedIndex);
            mEffectDefinition.Techniques[effectTechniquesList.SelectedIndex] = technique;

            int selectedIndex = effectTechniquePassesList.SelectedIndex;

            if (selectedIndex >= technique.Passes.Count)
            {
                selectedIndex = technique.Passes.Count - 1;
            }
            effectTechniquePassesList.DataSource    = null;
            effectTechniquePassesList.DataSource    = technique.Passes;
            effectTechniquePassesList.SelectedIndex = selectedIndex;
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: profexorgeek/FlatRedBall
        private void techniqueNameBox_TextChanged(object sender, EventArgs e)
        {
            mSuspendTechniqueChange = true;

            EffectTechniqueDefinition technique = mEffectDefinition.Techniques[effectTechniquesList.SelectedIndex];

            technique.Name = techniqueNameBox.Text;
            mEffectDefinition.Techniques[effectTechniquesList.SelectedIndex] = technique;

            effectTechniquesList.SuspendLayout();
            int selectedIndex = effectTechniquesList.SelectedIndex;

            effectTechniquesList.DataSource    = null;
            effectTechniquesList.DataSource    = mEffectDefinition.Techniques;
            effectTechniquesList.SelectedIndex = selectedIndex;
            effectTechniquesList.ResumeLayout();

            mSuspendTechniqueChange = false;
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: profexorgeek/FlatRedBall
        private void addPassButton_Click(object sender, EventArgs e)
        {
            EffectTechniqueDefinition technique = mEffectDefinition.Techniques[effectTechniquesList.SelectedIndex];

            technique.Passes.Add(new EffectPassDefinition(
                                     "Pass" + technique.Passes.Count.ToString(),
                                     (mEffectDefinition.VertexShaders.Count > 0) ? mEffectDefinition.VertexShaders[0].Name : String.Empty,
                                     (mEffectDefinition.PixelShaders.Count > 0) ? mEffectDefinition.PixelShaders[0].Name : String.Empty,
                                     (mEffectDefinition.VertexShaders.Count > 0) ?
                                     (ShaderProfile)Enum.Parse(typeof(ShaderProfile), mEffectDefinition.VertexShaders[0].MinimumVertexShaderProfile, true) : ShaderProfile.VS_1_1,
                                     (mEffectDefinition.PixelShaders.Count > 0) ?
                                     (ShaderProfile)Enum.Parse(typeof(ShaderProfile), mEffectDefinition.PixelShaders[0].MinimumPixelShaderProfile, true) : ShaderProfile.PS_1_1));

            mEffectDefinition.Techniques[effectTechniquesList.SelectedIndex] = technique;

            effectTechniquePassesList.DataSource = null;
            effectTechniquePassesList.DataSource = technique.Passes;

            effectTechniquePassesList.SelectedIndex = technique.Passes.Count - 1;
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: profexorgeek/FlatRedBall
        private void effectTechniquesList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!mSuspendTechniqueChange)
            {
                effectTechniquePassesEditor.Enabled = (effectTechniquesList.SelectedIndex >= 0);

                if (effectTechniquesList.SelectedIndex >= 0)
                {
                    EffectTechniqueDefinition technique = mEffectDefinition.Techniques[
                        effectTechniquesList.SelectedIndex];

                    effectTechniquePassesList.DataSource = null;
                    effectTechniquePassesList.DataSource = technique.Passes;
                    effectTechniquePassesList.ClearSelected();

                    techniqueNameBox.Text = technique.Name;

                    if (technique.Passes.Count > 0)
                    {
                        effectTechniquePassesList.SelectedIndex = 0;
                    }
                }
            }
        }