Beispiel #1
0
        public void RenderBorderBack(ISquare square)
        {
            if (_glUtils.DrawQuad(_frameBuffer, square, _quad))
            {
                return;
            }

            float    width      = _settings.VirtualResolution.Width;
            float    height     = _settings.VirtualResolution.Height;
            float    foldWidth  = (width) * (1f / 5f);
            float    foldHeight = (height) * (1f / 5f);
            IGLColor color      = IsSelected ? _selectedColor : _color;
            IGLColor foldColor  = IsSelected ? _selectedFoldColor : _foldColor;

            Vector3 foldBottomLeft = new Vector3(width - foldWidth, foldHeight, 0);
            Vector3 foldTopLeft    = new Vector3(width - foldWidth, 0, 0);
            Vector3 foldTopRight   = new Vector3(width, foldHeight, 0);

            _frameBuffer = _glUtils.BeginFrameBuffer(square, _settings);
            _glUtils.DrawQuad(0, new Vector3(0f, height, 0), new Vector3(width - foldWidth, height, 0),
                              new Vector3(), foldTopLeft,
                              color, color, color, color);

            _glUtils.DrawQuad(0, new Vector3(width - foldWidth, height, 0), new Vector3(width, height, 0),
                              foldBottomLeft, foldTopRight,
                              color, color, color, color);

            _glUtils.DrawTriangle(0, new GLVertex[] { new GLVertex(foldBottomLeft.Xy, _emptyVector, foldColor),
                                                      new GLVertex(foldTopLeft.Xy, _emptyVector, foldColor), new GLVertex(foldTopRight.Xy, _emptyVector, foldColor) });
            _frameBuffer.End();

            _glUtils.DrawQuad(_frameBuffer, square, _quad);
        }
Beispiel #2
0
        public void RenderBorderFront(AGSBoundingBox square)
        {
            if (_settings.WindowSize.Equals(_lastWindowSize) && _lastSquare.SameSize(square) &&
                _glUtils.DrawQuad(_frameBuffer, square, _quad))
            {
                return;
            }

            _frameBuffer?.Dispose();
            _lastSquare     = square;
            _lastWindowSize = _settings.WindowSize;

            float width  = _glUtils.CurrentResolution.Width - _padding;
            float height = _glUtils.CurrentResolution.Height - _padding;

            _frameBuffer = _glUtils.BeginFrameBuffer(square, _settings);
            if (_frameBuffer == null)
            {
                return;
            }
            _glUtils.DrawLine(_padding, _padding, width, height, _lineWidth, _color.R, _color.G, _color.B, _color.A);
            _glUtils.DrawLine(_padding, height, width, _padding, _lineWidth, _color.R, _color.G, _color.B, _color.A);

            _frameBuffer.End();

            _glUtils.DrawQuad(_frameBuffer, square, _quad);
        }
Beispiel #3
0
        public void RenderBorderBack(ISquare square)
        {
            if (_glUtils.DrawQuad(_frameBuffer, square, _quad))
            {
                return;
            }

            float    width      = _settings.VirtualResolution.Width;
            float    height     = _settings.VirtualResolution.Height;
            IGLColor color      = IsSelected ? _selectedColor : _color;
            IGLColor foldColor  = IsSelected ? _selectedFoldColor : _foldColor;
            float    foldHeight = height * (1f / 5f);
            PointF   foldBottom = new PointF(width / 2f, foldHeight);

            _frameBuffer = _glUtils.BeginFrameBuffer(square, _settings);
            _glUtils.DrawQuad(0, new Vector3(0, height, 0), new Vector3(width, height, 0),
                              new Vector3(), new Vector3(width, 0, 0),
                              color, color, color, color);

            _glUtils.DrawTriangle(0, new GLVertex[] { new GLVertex(new Vector2(), _emptyVector, foldColor),
                                                      new GLVertex(foldBottom.ToVector2(), _emptyVector, foldColor), new GLVertex(new Vector2(width, 0), _emptyVector, foldColor) });
            _frameBuffer.End();

            _glUtils.DrawQuad(_frameBuffer, square, _quad);
        }
Beispiel #4
0
 public void Render(int texture, AGSBoundingBoxes boundingBoxes, IGLColor color)
 {
     if (boundingBoxes.TextureBox == null)
     {
         _glUtils.DrawQuad(texture, boundingBoxes.RenderBox, color.R, color.G, color.B, color.A);
     }
     else
     {
         _glUtils.DrawQuad(texture, boundingBoxes.RenderBox, color, boundingBoxes.TextureBox);
     }
 }
Beispiel #5
0
        public void RenderBorderBack(ISquare square)
        {
            if (_glUtils.DrawQuad(_frameBuffer, square, _quad))
            {
                return;
            }

            float width           = _settings.VirtualResolution.Width;
            float height          = _settings.VirtualResolution.Height;
            float arrowWidth      = width * (1f / 2f);
            float arrowHeight     = height * (1f / 2f);
            float remainingWidth  = width - arrowWidth;
            float remainingHeight = height - arrowHeight;

            PointF point1, point2, point3;

            switch (Direction)
            {
            case ArrowDirection.Right:
                point1 = new PointF(remainingWidth / 2f, remainingHeight / 2f);          // square.TopLeft + new PointF(remainingWidth / 2f, -remainingHeight / 2f);
                point2 = new PointF(remainingWidth / 2f, height - remainingHeight / 2f); //square.BottomLeft + new PointF(remainingWidth / 2f, remainingHeight / 2f);
                point3 = new PointF(width - remainingWidth / 2f, height / 2f);           //square.BottomRight + new PointF(-remainingWidth / 2f, height / 2f);
                break;

            case ArrowDirection.Down:
                point1 = new PointF(remainingWidth / 2f, remainingHeight / 2f);
                point2 = new PointF(width / 2f, height - remainingHeight / 2f);
                point3 = new PointF(width - remainingWidth / 2f, remainingHeight / 2f);
                break;

            case ArrowDirection.Left:
                point1 = new PointF(width - remainingWidth / 2f, height - remainingHeight / 2f);
                point2 = new PointF(width - remainingWidth / 2f, remainingHeight / 2f);
                point3 = new PointF(remainingWidth / 2f, height / 2f);
                break;

            case ArrowDirection.Up:
                point1 = new PointF(remainingWidth / 2f, height - remainingHeight / 2f);
                point2 = new PointF(width / 2f, remainingHeight / 2f);
                point3 = new PointF(width - remainingWidth / 2f, height - remainingHeight / 2f);
                break;

            default: throw new NotSupportedException(Direction.ToString());
            }

            _frameBuffer = _glUtils.BeginFrameBuffer(square, _settings);
            _glUtils.DrawTriangle(0, new GLVertex[] { new GLVertex((point1).ToVector2(), _emptyVector, ArrowColor),
                                                      new GLVertex((point2).ToVector2(), _emptyVector, ArrowColor), new GLVertex((point3).ToVector2(), _emptyVector, ArrowColor) });
            _frameBuffer.End();

            _glUtils.DrawQuad(_frameBuffer, square, _quad);
        }
Beispiel #6
0
        private void drawQuad(AGSBoundingBox quad, AGSBoundingBox border, FourCorners <IGLColor> colors)
        {
            GLColor bottomLeftColor  = getColor(colors, border, quad.BottomLeft);
            GLColor bottomRightColor = getColor(colors, border, quad.BottomRight);
            GLColor topRightColor    = getColor(colors, border, quad.TopRight);
            GLColor topLeftColor     = getColor(colors, border, quad.TopLeft);

            _glUtils.DrawQuad(0, quad.BottomLeft, quad.BottomRight,
                              quad.TopLeft, quad.TopRight, bottomLeftColor, bottomRightColor, topLeftColor, topRightColor);
        }
Beispiel #7
0
        public void Render(int texture, IGLBoundingBox boundingBox, IGLColor color)
        {
            Vector3 bottomLeft  = boundingBox.BottomLeft;
            Vector3 topLeft     = boundingBox.TopLeft;
            Vector3 bottomRight = boundingBox.BottomRight;
            Vector3 topRight    = boundingBox.TopRight;

            _glUtils.DrawQuad(texture, bottomLeft, bottomRight, topLeft, topRight, color.R,
                              color.G, color.B, color.A);
        }
Beispiel #8
0
        private void drawQuad(ISquare quad, ISquare border, FourCorners <IGLColor> colors)
        {
            GLColor bottomLeftColor  = getColor(colors, border, quad.BottomLeft);
            GLColor bottomRightColor = getColor(colors, border, quad.BottomRight);
            GLColor topRightColor    = getColor(colors, border, quad.TopRight);
            GLColor topLeftColor     = getColor(colors, border, quad.TopLeft);

            _glUtils.DrawQuad(0, quad.BottomLeft.ToVector3(), quad.BottomRight.ToVector3(),
                              quad.TopLeft.ToVector3(), quad.TopRight.ToVector3(), bottomLeftColor, bottomRightColor, topLeftColor, topRightColor);
        }
Beispiel #9
0
        public void RenderBorderFront(AGSBoundingBox square)
        {
            if (_glUtils.DrawQuad(_frameBuffer, square, _quad))
            {
                return;
            }

            float width  = _glUtils.CurrentResolution.Width - _padding;
            float height = _glUtils.CurrentResolution.Height - _padding;

            _frameBuffer = _glUtils.BeginFrameBuffer(square, _settings);
            if (_frameBuffer == null)
            {
                return;
            }
            _glUtils.DrawLine(_padding, _padding, width, height, _lineWidth, _color.R, _color.G, _color.B, _color.A);
            _glUtils.DrawLine(_padding, height, width, _padding, _lineWidth, _color.R, _color.G, _color.B, _color.A);

            _frameBuffer.End();

            _glUtils.DrawQuad(_frameBuffer, square, _quad);
        }
Beispiel #10
0
 public void Render(ITexture texture, float r = 1f, float g = 1f, float b = 1f, float a = 1f)
 {
     _glUtils.DrawQuad(texture == null ? 0 : texture.ID, _box, r, g, b, a);
 }
 private void drawQuad(AGSBoundingBox quad, FourCorners <Vector2> texturePos)
 {
     _glUtils.DrawQuad(_texture, quad, _white, texturePos);
 }
Beispiel #12
0
 private void drawQuad(ISquare quad, FourCorners <Vector2> texturePos)
 {
     _glUtils.DrawQuad(_texture, quad.BottomLeft.ToVector3(), quad.BottomRight.ToVector3(),
                       quad.TopLeft.ToVector3(), quad.TopRight.ToVector3(), _white, texturePos);
 }
Beispiel #13
0
 public void Render(ITexture texture, float r = 1f, float g = 1f, float b = 1f, float a = 1f)
 {
     _glUtils.DrawQuad(texture == null ? 0 : texture.ID, BottomLeft, BottomRight, TopLeft, TopRight, r, g, b, a);
 }