Esempio n. 1
0
        protected override void OnRenderFrame(FrameEventArgs e)
        {
            if (!Ready || Stopped)
            {
                return;
            }

            timer.Restart();

            MasterRenderer.Render();

            lock (MasterRenderer.GLLock)
            {
                SwapBuffers();
            }

            PerfInfo.RenderLoop(timer.Stop(), 1 / e.Time);
            if (GlobalRender % 20 == 0)
            {
                if (Settings.LogTimeMeasuring)
                {
                    Log.Performance(PerfInfo.FMS, " render " + GlobalRender);
                }

                if (Settings.DeveloperMode || Program.IsDebug)
                {
                    Title = $"{Program.Title} [{MasterRenderer.RenderCalls} Calls, {MasterRenderer.Batches} Batches]";
                }
            }

            GlobalRender++;

            sleep();
        }
Esempio n. 2
0
        protected override void OnUpdateFrame(FrameEventArgs e)
        {
            if (!Ready)
            {
                return;
            }

            timer.Restart();

            GameController.Tick();
            MusicController.Tick();

            MouseInput.Tick();
            KeyInput.Tick();

            PerfInfo.UpdateLoop(timer.Stop(), 1 / e.Time);
            if (Settings.LogTimeMeasuring && GlobalTick % 20 == 0)
            {
                Log.Performance(PerfInfo.TMS, " tick " + GlobalTick);
            }

            GlobalTick++;
        }