public override void RGBAlphaBlendEquation(BlendEquation BlendEquationRGB, BlendEquation BlendEquationAlpha)
 {
     BlendOp      = blendOps[(int)BlendEquationRGB];
     BlendOpAlpha = blendOps[(int)BlendEquationAlpha];
     device.SetRenderState(RenderState.BlendOperation, (int)BlendOp);
     device.SetRenderState(RenderState.BlendOperationAlpha, (int)BlendOpAlpha);
 }
Exemple #2
0
 public BlendState(BlendFactor sourceRgb, BlendFactor sourceAlpha, BlendFactor destinationRgb, BlendFactor destinationAlpha, BlendEquation equationRgb, BlendEquation equationAlpha)
 {
     SourceRgb        = sourceRgb;
     SourceAlpha      = sourceAlpha;
     DestinationRgb   = destinationRgb;
     DestinationAlpha = destinationAlpha;
     EquationRgb      = equationRgb;
     EquationAlpha    = equationAlpha;
 }
        private BlendOperation GetBlendOperation(BlendEquation value)
        {
            switch(value)
            {
                case BlendEquation.AddBothValues: return BlendOperation.Add;
                case BlendEquation.SubtractFirstFromSecond: return BlendOperation.Subtract;
                case BlendEquation.SubtractSecondFromFirst: return BlendOperation.ReverseSubtract;
                case BlendEquation.Minimum: return BlendOperation.Minimum;
                case BlendEquation.Maximum: return BlendOperation.Maximum;
            }

            throw new NotSupportedException("The specified blend operation is not supported");
        }
Exemple #4
0
        private static void Load_VERSION_1_4()
        {
            BlendFuncSeparate  = GetAddress <BlendFuncSeparate>("glBlendFuncSeparate");
            MultiDrawArrays    = GetAddress <MultiDrawArrays>("glMultiDrawArrays");
            _MultiDrawElements = GetAddress <MultiDrawElements>("glMultiDrawElements");
            PointParameterf    = GetAddress <PointParameterf>("glPointParameterf");
            PointParameterfv   = GetAddress <PointParameterfv>("glPointParameterfv");
            _PointParameteri   = GetAddress <PointParameteri>("glPointParameteri");
            PointParameteriv   = GetAddress <PointParameteriv>("glPointParameteriv");
            BlendColor         = GetAddress <BlendColor>("glBlendColor");
            BlendEquation      = GetAddress <BlendEquation>("glBlendEquation");

            VERSION_1_4 = VERSION_1_3 && BlendFuncSeparate != null && MultiDrawArrays != null && _MultiDrawElements != null &&
                          PointParameterf != null && _PointParameteri != null && BlendColor != null && BlendEquation != null;
        }
Exemple #5
0
        private BlendOperation GetBlendOperation(BlendEquation value)
        {
            switch (value)
            {
            case BlendEquation.AddBothValues: return(BlendOperation.Add);

            case BlendEquation.SubtractFirstFromSecond: return(BlendOperation.Subtract);

            case BlendEquation.SubtractSecondFromFirst: return(BlendOperation.ReverseSubtract);

            case BlendEquation.Minimum: return(BlendOperation.Minimum);

            case BlendEquation.Maximum: return(BlendOperation.Maximum);
            }

            throw new NotSupportedException("The specified blend operation is not supported");
        }
Exemple #6
0
 public BlendState(
     bool enabled,
     BlendFactor colourSource,
     BlendFactor alphaSource,
     BlendFactor colourDestination,
     BlendFactor alphaDestination,
     BlendEquation colourEquation,
     BlendEquation alphaEquation)
 {
     Enabled           = enabled;
     ColourSource      = colourSource;
     AlphaSource       = alphaSource;
     ColourDestination = colourDestination;
     AlphaDestination  = alphaDestination;
     ColourEquation    = colourEquation;
     AlphaEquation     = alphaEquation;
 }
Exemple #7
0
        public static BlendEquationMode To(BlendEquation equation)
        {
            switch (equation)
            {
            case BlendEquation.Add:
                return(BlendEquationMode.FuncAdd);

            case BlendEquation.Minimum:
                return(BlendEquationMode.Min);

            case BlendEquation.Maximum:
                return(BlendEquationMode.Max);

            case BlendEquation.Subtract:
                return(BlendEquationMode.FuncSubtract);

            case BlendEquation.ReverseSubtract:
                return(BlendEquationMode.FuncReverseSubtract);
            }

            throw new ArgumentException("equation");
        }
Exemple #8
0
        internal static double ToWebGL2(this BlendEquation blendEquation)
        {
            switch (blendEquation)
            {
            case BlendEquation.Add:
                return(FUNC_ADD);

            case BlendEquation.Subtract:
                return(FUNC_SUBTRACT);

            case BlendEquation.ReverseSubtract:
                return(FUNC_REVERSE_SUBTRACT);

            case BlendEquation.Max:
                return(WebGL2Graphics.MAX);

            case BlendEquation.Min:
                return(WebGL2Graphics.MIN);

            default:
                throw new IllegalValueException(typeof(BlendEquation), blendEquation);
            }
        }
        internal static double ToWebGL(this BlendEquation blendEquation)
        {
            switch (blendEquation)
            {
            case BlendEquation.Add:
                return(GL.FUNC_ADD);

            case BlendEquation.Subtract:
                return(GL.FUNC_SUBTRACT);

            case BlendEquation.ReverseSubtract:
                return(GL.FUNC_REVERSE_SUBTRACT);

            case BlendEquation.Max:
                return(Extensions.EXT_blend_minmax.MAX_EXT);

            case BlendEquation.Min:
                return(Extensions.EXT_blend_minmax.MIN_EXT);

            default:
                throw new IllegalValueException(typeof(BlendEquation), blendEquation);
            }
        }
Exemple #10
0
        internal static OpenGLBindings.BlendEquation ToOpenGL(this BlendEquation blendEquation)
        {
            switch (blendEquation)
            {
            case BlendEquation.Add:
                return(OpenGLBindings.BlendEquation.Add);

            case BlendEquation.Subtract:
                return(OpenGLBindings.BlendEquation.Subtract);

            case BlendEquation.ReverseSubtract:
                return(OpenGLBindings.BlendEquation.ReverseSubtract);

            case BlendEquation.Max:
                return(OpenGLBindings.BlendEquation.Max);

            case BlendEquation.Min:
                return(OpenGLBindings.BlendEquation.Min);

            default:
                throw new IllegalValueException(typeof(BlendEquation), blendEquation);
            }
        }
 public BlendState(BlendFactor source, BlendFactor destination, BlendEquation equation)
     : this(source, source, destination, destination, equation, equation)
 {
 }
 public BlendState(BlendFactor sourceRgb, BlendFactor sourceAlpha, BlendFactor destinationRgb, BlendFactor destinationAlpha, BlendEquation equationRgb, BlendEquation equationAlpha)
 {
     SourceRgb = sourceRgb;
     SourceAlpha = sourceAlpha;
     DestinationRgb = destinationRgb;
     DestinationAlpha = destinationAlpha;
     EquationRgb = equationRgb;
     EquationAlpha = equationAlpha;
 }
Exemple #13
0
 public override void RGBAlphaBlendEquation(BlendEquation BlendEquationRGB, BlendEquation BlendEquationAlpha)
 {
     GL.BlendEquationSeparate(blendEquations[(int)BlendEquationRGB], blendEquations[(int)BlendEquationAlpha]);
 }
Exemple #14
0
 public void BlendEquation(BlendEquation equation)
 {
     glBlendEquation((int)equation);
 }
Exemple #15
0
 public BlendState(BlendFactor source, BlendFactor destination, BlendEquation equation) : this(source, source, destination, destination, equation, equation)
 {
 }
Exemple #16
0
 public void SetEquation(BlendEquation equation)
 {
     GI.BlendEquation(equation);
 }
Exemple #17
0
 public BlendMode(BlendEquation equation, BlendingFactor sourceFactor, BlendingFactor destinationFactor)
 {
     this.Equation          = equation;
     this.SourceFactor      = sourceFactor;
     this.DestinationFactor = destinationFactor;
 }
Exemple #18
0
 public BlendMode(BlendFactor src, BlendFactor dst, BlendEquation eq)
 {
     Src = src;
     Dst = dst;
     Eq  = eq;
 }
Exemple #19
0
 public abstract void RGBAlphaBlendEquation(BlendEquation BlendEquationRGB, BlendEquation BlendEquationAlpha);
Exemple #20
0
 public static void InitGL_1_2(OpenGLContext ctx)
 {
     glBlendColor = ctx.GetProc<BlendColor>("glBlendColor");
     glBlendEquation = ctx.GetProc<BlendEquation>("glBlendEquation");
     glDrawRangeElements = ctx.GetProc<DrawRangeElements>("glDrawRangeElements");
     glTexImage3D = ctx.GetProc<TexImage3D>("glTexImage3D");
     glTexSubImage3D = ctx.GetProc<TexSubImage3D>("glTexSubImage3D");
     glCopyTexSubImage3D = ctx.GetProc<CopyTexSubImage3D>("glCopyTexSubImage3D");
 }
        public static BlendEquationMode To(BlendEquation equation)
        {
            switch (equation)
            {
                case BlendEquation.Add:
                    return BlendEquationMode.FuncAdd;
                case BlendEquation.Minimum:
                    return BlendEquationMode.Min;
                case BlendEquation.Maximum:
                    return BlendEquationMode.Max;
                case BlendEquation.Subtract:
                    return BlendEquationMode.FuncSubtract;
                case BlendEquation.ReverseSubtract:
                    return BlendEquationMode.FuncReverseSubtract;
            }

            throw new ArgumentException("equation");
        }