private void OnRender(object sender, PaintEventArgs e) { stopwatch.Stop(); double delta = stopwatch.Elapsed.TotalMilliseconds * 0.001; stopwatch.Restart(); time += delta; if (time >= fpsSecond) { fpsLabel.Text = string.Format("Application: {0:0}FPS. GLGUI: {1:0.0}ms", fpsCounter, glgui.RenderDuration); fpsCounter = 0; fpsSecond++; } if (consoleWriter.Changed) { console.Text = string.Join("\n", consoleWriter.Lines); consoleWriter.Changed = false; } glgui.Render(); SwapBuffers(); fpsCounter++; }
private void OnRender(object sender, PaintEventArgs e) { try { MakeCurrent(); glGui.Render(); SwapBuffers(); Context.MakeCurrent(null); } catch (GraphicsContextException) { } }
private void OnRender(object sender, FrameEventArgs e) { time += e.Time; if (time >= fpsSecond) { fpsLabel.Text = string.Format("Application: {0:0}FPS. GLGUI: {1:0.0}ms", fpsCounter, glgui.RenderDuration); fpsCounter = 0; fpsSecond++; } if (consoleWriter.Changed) { console.Text = string.Join("\n", consoleWriter.Lines); consoleWriter.Changed = false; } glgui.Render(); SwapBuffers(); fpsCounter++; }