public override void Update(RenderContext context) { base.Update(context); var io = ImGui.GetIO(); io.DisplaySize = new System.Numerics.Vector2((int)context.ActualWidth, (int)context.ActualHeight); UpdatingImGuiUI?.Invoke(this, EventArgs.Empty); }
public override void Update(RenderContext context) { base.Update(context); if (newFrame) { newFrame = false; ImGui.Render(); } var io = ImGui.GetIO(); io.DisplaySize = new System.Numerics.Vector2((int)(context.ActualWidth * context.DpiScale), (int)(context.ActualHeight * context.DpiScale)); if (previousTime == TimeSpan.Zero) { previousTime = context.TimeStamp; } io.Framerate = (float)(context.TimeStamp - previousTime).TotalSeconds; previousTime = context.TimeStamp; ImGui.NewFrame(); UpdatingImGuiUI?.Invoke(this, EventArgs.Empty); }