Beispiel #1
0
        public void Mix(IMixStage stage, ITexture texMix, ITexture tex0, ITexture tex1, ITexture tex2, ITexture tex3, IRenderTarget target)
        {
            if (stage == null)
            {
                throw new Yak2DException("Unable to queue MixStage. Stage is null", new ArgumentNullException());
            }

            //Null Mix Texture just uses a White Pixel Texture as equal 1.0 mixing
            //if (texMix == null)
            //{
            //    throw new Yak2DException("Unable to queue MixStage. Mix Texture is null", new ArgumentNullException());
            //}

            if (target == null)
            {
                throw new Yak2DException("Unable to queue MixStage. Target is null", new ArgumentNullException());
            }

            CheckForDuplicatedSurfaces("MixStage", texMix, tex0, tex1, tex2, tex3, target);

            //We are hijacking the Queue command
            _commandQueue.Add(RenderCommandType.MixStage,
                              stage.Id,
                              target.Id,
                              tex0 == null ? 0UL : tex0.Id,
                              tex1 == null ? 0UL : tex1.Id,
                              tex2 == null ? 0UL : tex2.Id,
                              tex3 == null ? 0UL : tex3.Id,
                              texMix == null ? 0UL : texMix.Id,
                              RgbaFloat.Clear
                              );
        }
Beispiel #2
0
        public void SetMixStageProperties(IMixStage stage, Vector4 amounts, float transitionSeconds, bool normalise)
        {
            if (stage == null)
            {
                throw new Yak2DException("Unable to set mix effect as stage passed is null");
            }

            SetMixStageProperties(stage.Id, amounts, transitionSeconds, normalise);
        }