public void DrawCrossLines() { OpenGL.PushMatrix(() => { MoveFiftyPixelsRight(); GL.Scale(1.0 / Window.DataWidth, 1.0 / Window.WindowHeight, 1); GL.Translate(-Window.DataOrigin.X, 50, 0); GL.Color4(0.0, 0.0, 0.0, 0.25); OpenGL.WithoutSmoothing(() => { OpenGL.Begin(BeginMode.Lines, () => { var majorTicks = RangeHelper.FindTicks(MajorTick, RangeStart, RangeStop); foreach (var tick in majorTicks) { GL.Vertex2(TickStart + tick, 0); GL.Vertex2(TickStart + tick, Window.WindowHeight); } }); }); }); }
void DrawText() { OpenGL.PushMatrix(() => { MoveFiftyPixelsRight(); GL.Scale(1.0 / Window.WindowWidth, 1.0 / Window.WindowHeight, 1.0); var majorTicks = RangeHelper.FindTicks(MajorTick, RangeStart, RangeStop); foreach (var tick in majorTicks) { var tickText = tick.ToString(CultureInfo.InvariantCulture); PieceOfText pot; if (_texts.ContainsKey(tickText)) { pot = _texts[tickText]; } else { pot = new PieceOfText(_font, tickText); _texts[tickText] = pot; } pot.Draw(new GLPoint(((tick - Window.Start) / Window.DataWidth) * Window.WindowWidth - 5, 0), null, null, false); } }); }