OpenBve.Renderer.SetAlphaFunc C# (CSharp) Méthode

SetAlphaFunc() private static méthode

private static SetAlphaFunc ( AlphaFunction Comparison, float Value ) : void
Comparison AlphaFunction
Value float
Résultat void
        private static void SetAlphaFunc(AlphaFunction Comparison, float Value)
        {
            AlphaFuncComparison = Comparison;
            AlphaFuncValue = Value;
            GL.AlphaFunc(Comparison, Value);
        }

Usage Example

Exemple #1
0
            internal override void RenderBackground(float Scale)
            {
                if (this.CurrentBackgroundIndex != this.PreviousBackgroundIndex)
                {
                    switch (this.Backgrounds[CurrentBackgroundIndex].Mode)
                    {
                    case BackgroundTransitionMode.FadeIn:
                        Renderer.RenderBackground(this.Backgrounds[PreviousBackgroundIndex], 1.0f, Scale);
                        Renderer.SetAlphaFunc(AlphaFunction.Greater, 0.0f);
                        Renderer.RenderBackground(this.Backgrounds[CurrentBackgroundIndex], this.CurrentAlpha, Scale);
                        break;

                    case BackgroundTransitionMode.FadeOut:
                        Renderer.RenderBackground(this.Backgrounds[CurrentBackgroundIndex], 1.0f, Scale);
                        Renderer.SetAlphaFunc(AlphaFunction.Greater, 0.0f);
                        Renderer.RenderBackground(this.Backgrounds[PreviousBackgroundIndex], this.CurrentAlpha, Scale);
                        break;
                    }
                }
                else
                {
                    Renderer.RenderBackground(this.Backgrounds[CurrentBackgroundIndex], 1.0f, Scale);
                }
            }
All Usage Examples Of OpenBve.Renderer::SetAlphaFunc