public void Apply(VGMatrix projection, VGMatrix transformation, Vector2 offset, Texture2D vertices, Texture2D offsets) { _projection.SetValue(projection); _transformation.SetValue(transformation); _offset.SetValue(offset); _offsets.SetValue(offsets); _vertices.SetValue(vertices); _numOffsets.SetValue(new Vector2(offsets.Width, offsets.Height)); _numVertices.SetValue(new Vector2(vertices.Width, vertices.Height)); _pass.Apply(); }
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(); }
public void SetSolid(bool isNonscaling, VGMatrix projection, VGMatrix transformation, float thickness) { _projection.SetValue(projection); _transformation.SetValue(transformation); _thickness.SetValue(thickness); _offset.SetValue(Vector2.Zero); if (isNonscaling) { _effect.CurrentTechnique = _nonscalingTechnique; _currentPass = _passSolidNS; } else { _effect.CurrentTechnique = _scalingTechnique; _currentPass = _passSolid; } }
public void Apply(VGMatrix projection, VGMatrix transformation) { _projection.SetValue(projection); _transformation.SetValue(transformation); _pass.Apply(); }
public void SetParameters(VGMatrix projection, VGMatrix transformation, VGCxForm cxForm) { _projection.SetValue(projection); _transformation.SetValue(transformation); _addTerm.SetValue(cxForm.AddTerm); _mulTerm.SetValue(cxForm.MulTerm); _offset.SetValue(Vector2.Zero); }
public void SetPaint(VGPaint paint, VGMatrix paintTransformation) { _passIndex &= ~1; _paintTransformation.SetValue(paintTransformation); _focalPoint.SetValue(new Vector2(paint.Type == VGPaintType.RadialGradient ? (paint as VGRadialPaint).FocalPoint : 0, 0)); _effect.CurrentTechnique = _techniques[(int)paint.Type]; switch (paint.Type) { case VGPaintType.Color: _color.SetValue((paint as VGColorPaint).Color.ToVector4()); break; case VGPaintType.Pattern: case VGPaintType.PatternPremultiplied: var pattern = (paint as VGPatternPaint).Pattern; _effect.GraphicsDevice.Textures[1] = pattern.Texture; _effect.GraphicsDevice.SamplerStates[1] = pattern.GetSamplerState(); if (pattern.LinearColorspace) _passIndex |= 1; break; case VGPaintType.LinearGradient: case VGPaintType.RadialGradient: var gradient = paint as VGGradientPaint; _effect.GraphicsDevice.Textures[1] = gradient.Gradient; _effect.GraphicsDevice.SamplerStates[1] = gradient.GetSamplerState(); if (gradient.LinearColorspace) _passIndex |= 1; break; default: throw new ArgumentException("Invalid paint type!", "paint"); } }
internal void Clear(VGMatrix baseMatrix) { Matrices.Clear(); Matrices.Push(baseMatrix); }
public void PushCombineRight(VGMatrix matrix) { Matrices.Push(Matrices.Peek() * matrix); }
public void PushCombineLeft(VGMatrix matrix) { Matrices.Push(matrix * Matrices.Peek()); }
public void Push(VGMatrix matrix) { Matrices.Push(matrix); }
public void SetParameters(VGMatrix projection, VGMatrix transformation) { _projection.SetValue(projection); _transformation.SetValue(transformation); _offset.SetValue(_offsetValue = Vector4.Zero); }