Example #1
0
    protected void UpdateEffectMask(Effects.Effect effect, RectangleF bounds, float width, float height, float zPos)
    {
      Color4 col = ColorConverter.FromColor(Color.White);
      col.Alpha *= (float) Opacity;

      PositionColoredTextured[] verts = PositionColoredTextured.CreateQuad_Fan(
          bounds.Left - 0.5f, bounds.Top - 0.5f, bounds.Right - 0.5f, bounds.Bottom - 0.5f,
          bounds.Left / width, bounds.Top / height, bounds.Right / width, bounds.Bottom / height,
          zPos, col);

      effect.SetupEffect(this, ref verts, zPos, false);
      PrimitiveBuffer.SetPrimitiveBuffer(ref _effectContext, ref verts, PrimitiveType.TriangleFan);
    }