Skip to content

Commit

Permalink
UI don't respond to input if window is not active
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczy93 committed Nov 7, 2023
1 parent 4f6fead commit 75bff59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CentrED/UI/UIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public void Update(GameTime gameTime, bool isActive)
var io = ImGui.GetIO();

io.DeltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds;

if(!isActive) return;

var mouse = Mouse.GetState();
var keyboard = Keyboard.GetState();
Expand All @@ -106,7 +108,6 @@ public void Update(GameTime gameTime, bool isActive)

io.DisplaySize = new Vector2(_graphicsDevice.PresentationParameters.BackBufferWidth, _graphicsDevice.PresentationParameters.BackBufferHeight);
io.DisplayFramebufferScale = new Vector2(1f, 1f);

}

internal double _framesPerSecond;
Expand Down

0 comments on commit 75bff59

Please sign in to comment.