예제 #1
0
        public void Blur(IBlurStage stage, ITexture source, IRenderTarget target)
        {
            if (stage == null)
            {
                throw new Yak2DException("Unable to queue Blur2DEffectStage. Stage is null", new ArgumentNullException());
            }

            if (source == null)
            {
                throw new Yak2DException("Unable to queue Blur2DEffectStage. Source is null", new ArgumentNullException());
            }

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

            if (source.Id == target.Id)
            {
                throw new Yak2DException("Unable to queue Blur2DEffectStage. Source and Target Surfaces cannot be the same", new ArgumentNullException());
            }

            _commandQueue.Add(RenderCommandType.Blur2DEffectStage,
                              stage.Id,
                              target.Id,
                              0UL,
                              source.Id,
                              0UL,
                              0UL,
                              0UL,
                              RgbaFloat.Clear);
        }
예제 #2
0
파일: Stages.cs 프로젝트: AlzPatz/yak2d
        public void SetBlurConfig(IBlurStage effect, BlurEffectConfiguration config, float transitionSeconds)
        {
            if (effect == null)
            {
                throw new Yak2DException("Unable to set blur2d effect as stage passed is null");
            }

            SetBlurConfig(effect.Id, config, transitionSeconds);
        }