コード例 #1
0
ファイル: CoverEffect.cs プロジェクト: liwq-net/XnaVG
        public void SetImagePaint(VGImage image, VGMatrix paintTransformation)
        {
            if (image.LinearColorspace)
                _passIndex |= 1;
            else
                _passIndex &= ~1;

            _effect.CurrentTechnique = _techniques[(int)(image.Premultiplied ? VGPaintType.PatternPremultiplied : VGPaintType.Pattern)];
            _paintTransformation.SetValue(paintTransformation);
            _focalPoint.SetValue(Vector2.Zero);
            _effect.GraphicsDevice.Textures[1] = image.Texture;
            _effect.GraphicsDevice.SamplerStates[1] = image.GetSamplerState();
        }
コード例 #2
0
ファイル: CoverEffect.cs プロジェクト: liwq-net/XnaVG
 public void SetMask(VGImage mask, Vector4 channels)
 {
     if (mask == null)
     {
         _passIndex &= ~2;
         _effect.GraphicsDevice.Textures[0] = null;
     }
     else
     {
         _passIndex |= 2;
         _effect.GraphicsDevice.Textures[0] = mask.Texture;
         _effect.GraphicsDevice.SamplerStates[0] = mask.GetSamplerState();
         _maskChannels.SetValue(channels);
     }
 }