コード例 #1
0
ファイル: GuiControl.cs プロジェクト: rainrcn/GLGUI
        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++;
        }
コード例 #2
0
 private void OnRender(object sender, PaintEventArgs e)
 {
     try
     {
         MakeCurrent();
         glGui.Render();
         SwapBuffers();
         Context.MakeCurrent(null);
     }
     catch (GraphicsContextException)
     {
     }
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: rainrcn/GLGUI
        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++;
        }