Esempio n. 1
0
        public void Render(ShaderColorXY shader, RectangleF view, Size areaInPixels, TimeStamp offset)
        {
            if (_vbo.Length == 0)
            {
                return;
            }

            // TODO: this should be done in Add
            //       as the buffer will be reloaded for every frame.
            //       Not much data to be copied, but still unnecessary.
            var lastVertex = _vbo[_vbo.Length - 1];

            _vbo.AddVertex(float.MaxValue, lastVertex.Y);
            _vbo.IndexFromLength();
            _vbo.Reload();

            shader.SetTranslateMatrix(Matrix4.Identity);
            shader.SetShaderColor(LineColor);

            var trsl = Matrix4.CreateTranslation(-offset.ToRate(SamplesPerSecond), 0, 0);

            shader.SetTranslateMatrix(trsl);

            GL.LineWidth(Selected ? 3.0f : 1.0f);
            _vbo.DrawMode = BeginMode.LineStrip;
            _vbo.BindAndDraw(shader);

            GL.PointSize(Selected ? 8.0f : 6.0f);
            _vbo.DrawMode = BeginMode.Points;
            _vbo.BindAndDraw(shader);

            _vbo.PopVertex();
        }
Esempio n. 2
0
 protected void DrawSelection()
 {
     if (SelectionVisible)
     {
         _shader.SetShaderColor(SelectionColor);
         _selection.BindAndDraw(_shader);
     }
 }
Esempio n. 3
0
        protected void DrawGridLines()
        {
            _shader.SetShaderMatrix(
                Matrix4.CreateOrthographicOffCenter(
                    0, 1,
                    (float)AxisY.VisibleMinimum,
                    (float)AxisY.VisibleMaximum,
                    -1, 1
                    )
                );

            _shader.SetTranslateMatrix(Matrix4.Identity);

            _shader.SetShaderColor(Color.DarkGray);

            GL.LineWidth(1.0f);

            _gridLines.BindAndDraw(_shader);
        }