Esempio n. 1
0
        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++;
        }
Esempio n. 2
0
 private void OnRender(object sender, PaintEventArgs e)
 {
     try
     {
         MakeCurrent();
         glGui.Render();
         SwapBuffers();
         Context.MakeCurrent(null);
     }
     catch (GraphicsContextException)
     {
     }
 }
Esempio n. 3
0
        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++;
        }