internal void RenderFrame(double delta) { frameTimer.Reset(); frameTimer.Start(); Graphics.BeginFrame(this); Graphics.BindIb(Graphics.defaultIb); accumulator += delta; Vertices = 0; Camera.UpdateMouse(); if (!window.Focused && !Gui.ActiveScreen.HandlesAllInput) { Gui.SetNewScreen(new PauseScreen(this)); } bool allowZoom = Gui.activeScreen == null && !Gui.hudScreen.HandlesAllInput; if (allowZoom && IsKeyDown(KeyBind.ZoomScrolling)) { Input.SetFOV(ZoomFov, false); } DoScheduledTasks(delta); float t = (float)(entTask.Accumulator / entTask.Interval); LocalPlayer.SetInterpPosition(t); if (!SkipClear) { Graphics.Clear(); } CurrentCameraPos = Camera.GetPosition(t); UpdateViewMatrix(); bool visible = Gui.activeScreen == null || !Gui.activeScreen.BlocksWorld; if (!World.HasBlocks) { visible = false; } if (visible) { Render3D(delta, t); } else { SelectedPos.SetAsInvalid(); } Gui.Render(delta); if (screenshotRequested) { TakeScreenshot(); } Graphics.EndFrame(this); LimitFPS(); }
internal void RenderFrame(double delta) { frameTimer.Reset(); frameTimer.Start(); Graphics.BeginFrame(this); Graphics.BindIb(defaultIb); accumulator += delta; Vertices = 0; Mode.BeginFrame(delta); Graphics.UpdateLightsEntity(); Camera.UpdateMouse(); if (!Focused && !Gui.ActiveScreen.HandlesAllInput) { Gui.SetNewScreen(new PauseScreen(this)); } CheckZoomFov(); DoScheduledTasks(delta); float t = (float)(entTask.Accumulator / entTask.Interval); LocalPlayer.SetInterpPosition(t); if (!SkipClear) { Graphics.Clear(); } CurrentCameraPos = Camera.GetCameraPos(t); UpdateViewMatrix(); bool visible = Gui.activeScreen == null || !Gui.activeScreen.BlocksWorld; if (!World.HasBlocks) { visible = false; } if (visible) { Render3D(delta, t); } else { SelectedPos.SetAsInvalid(); } Gui.Render(delta); if (screenshotRequested) { TakeScreenshot(); } Mode.EndFrame(delta); Graphics.EndFrame(this); LimitFPS(); }