Exemplo n.º 1
0
        void UpdateCursorShape(RectangleF cursorBounds, float zPos)
        {
            DeallocateCursor();

            PositionColoredTextured[] verts = PositionColoredTextured.CreateQuad_Fan(
                cursorBounds.Left /*- 0.5f*/, cursorBounds.Top /*- 0.5f*/, cursorBounds.Right /*- 0.5f*/, cursorBounds.Bottom /*- 0.5f*/,
                0, 0, 0, 0, zPos, Color);

            if (_cursorBrushInvalid && _cursorBrush != null)
            {
                _cursorBrush.Deallocate();
                _cursorBrush.Dispose();
                _cursorBrush = null;
            }
            if (_cursorBrush == null)
            {
                _cursorBrush = new SolidColorBrush {
                    Color = Color
                }
            }
            ;
            _cursorBrushInvalid = false;

            _cursorBrush.SetupBrush(this, ref verts, zPos, false);
            PrimitiveBuffer.SetPrimitiveBuffer(ref _cursorContext, ref verts, PrimitiveType.TriangleFan);

            _cursorShapeInvalid = false;
        }
Exemplo n.º 2
0
    void UpdateCursorShape(RectangleF cursorBounds, float zPos)
    {
      DeallocateCursor();

      PositionColoredTextured[] verts = PositionColoredTextured.CreateQuad_Fan(
          cursorBounds.Left - 0.5f, cursorBounds.Top - 0.5f, cursorBounds.Right - 0.5f, cursorBounds.Bottom - 0.5f,
          0, 0, 0, 0, zPos, Color);

      if (_cursorBrushInvalid && _cursorBrush != null)
      {
        _cursorBrush.Deallocate();
        _cursorBrush.Dispose();
        _cursorBrush = null;
      }
      if (_cursorBrush == null)
        _cursorBrush = new SolidColorBrush { Color = Color };
      _cursorBrushInvalid = false;

      _cursorBrush.SetupBrush(this, ref verts, zPos, false);
      PrimitiveBuffer.SetPrimitiveBuffer(ref _cursorContext, ref verts, PrimitiveType.TriangleFan);

      _cursorShapeInvalid = false;
    }