EditorGui setup
This commit is contained in:
@ -9,7 +9,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace Nerfed.Runtime.Gui;
|
||||
|
||||
internal class GuiController : IDisposable
|
||||
public class GuiController : IDisposable
|
||||
{
|
||||
public event Action OnGui;
|
||||
|
||||
@ -144,9 +144,13 @@ internal class GuiController : IDisposable
|
||||
io.BackendFlags |= ImGuiBackendFlags.HasSetMousePos;
|
||||
io.BackendFlags |= ImGuiBackendFlags.PlatformHasViewports;
|
||||
io.BackendFlags |= ImGuiBackendFlags.RendererHasViewports;
|
||||
|
||||
UpdatePerFrameImGuiData(1.0 / 60.0);
|
||||
ImGui.NewFrame();
|
||||
frameBegun = true;
|
||||
}
|
||||
|
||||
public void Update(float deltaTime)
|
||||
public void Update(double deltaTime)
|
||||
{
|
||||
if (frameBegun)
|
||||
{
|
||||
@ -167,12 +171,12 @@ internal class GuiController : IDisposable
|
||||
ImGui.EndFrame();
|
||||
}
|
||||
|
||||
private void UpdatePerFrameImGuiData(float deltaSeconds)
|
||||
private void UpdatePerFrameImGuiData(double deltaSeconds)
|
||||
{
|
||||
ImGuiIOPtr io = ImGui.GetIO();
|
||||
io.DisplaySize = new Vector2(mainWindow.Width, mainWindow.Height);
|
||||
io.DisplayFramebufferScale = new Vector2(1, 1);
|
||||
io.DeltaTime = deltaSeconds; // DeltaTime is in seconds.
|
||||
io.DeltaTime = (float)deltaSeconds; // DeltaTime is in seconds.
|
||||
}
|
||||
|
||||
private void UpdateInput()
|
||||
|
Reference in New Issue
Block a user