public virtual void Render(Flat6Engine engine, NvgContext context, FrameEventArgs e) { _fpsGraph.UpdateGraph((float)engine.Window.RenderTime); context.FillColor(NanoVg.Rgba(255, 255, 255, 255)); context.FontFace("engine_mono"); context.FontSize(18); context.TextAlign(NvgAlign.Top | NvgAlign.Left); _fpsGraph.RenderGraph(context, 3, 3); _tpsGraph.RenderGraph(context, 3, 45); }
protected override void OnRenderFrame(FrameEventArgs e) { base.OnRenderFrame(e); PerfGraph.UpdateGraph((float)e.Time); GL.Viewport(0, 0, Width, Height); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit | ClearBufferMask.StencilBufferBit); NanoVG.nvgBeginFrame(ctx, Width, Height, 1); if (screen) { screen.Draw(ctx); } PerfGraph.RenderGraph(ctx, 5, 5); NanoVG.nvgEndFrame(ctx); this.SwapBuffers(); }
public void Update() { if (_worker is null) { _worker = new Thread(() => { while (true) { while (!_bgJobs.IsEmpty) { if (!_bgJobs.TryDequeue(out var job)) { Lumberjack.Warn("Unable to dequeue BG job"); return; } job.Execute(this); } _workerHandle.Reset(); _workerHandle.WaitOne(); } }); _worker.Start(); } while (!_fgJobs.IsEmpty) { if (!_fgJobs.TryDequeue(out var job)) { Lumberjack.Warn("Unable to dequeue FG job"); return; } job.Execute(this); Application.DoEvents(); } _perfGraphFps.UpdateGraph((float)_window.RenderTime); }
public void Update(Flat6Engine engine, FrameEventArgs e) { _tpsGraph.UpdateGraph((float)engine.Window.UpdateTime); }
public void Clear() { _line.MagnitudeList.Clear(); _owner.UpdateGraph(); }