Skip to content

New HandleInput() loop added to the main game loop. #146

Merged
SoloByte merged 1 commit intomainfrom
new-handle-input-loop
Jan 22, 2026
Merged

New HandleInput() loop added to the main game loop. #146
SoloByte merged 1 commit intomainfrom
new-handle-input-loop

Conversation

@SoloByte
Copy link
Collaborator

  • HandleInput is called before update and is not affected by fixed framerate or dynamic substepping.
  • HandleInput is in sync with Draw() and the main game loop.

This creates a logical place for input handling and decouples (possible fixed) update and input handling.

… is called before update and is not affected by fixed framerate or dynamic substepping. HandleInput is in sync with Draw() and the main game loop.
@SoloByte SoloByte added this to the 5.0 (current) milestone Jan 21, 2026
@SoloByte SoloByte self-assigned this Jan 21, 2026
@SoloByte SoloByte linked an issue Jan 21, 2026 that may be closed by this pull request
@SoloByte SoloByte moved this from Inbox to Review in Shape Engine Roadmap Jan 21, 2026
@SoloByte SoloByte requested a review from Copilot January 21, 2026 16:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a dedicated HandleInput() method to the game loop that decouples input handling from the update logic. The new method is called once per frame before any update logic and uses raw frame time (not affected by fixed framerate or dynamic substepping), creating a clear separation of concerns between input processing and game state updates.

Changes:

  • Added HandleInput() method to the game loop hierarchy (Game, Scene, and CustomEvent classes)
  • Replaced obsolete fixed update interpolation hooks in CustomEvent with the new HandleInput hooks
  • Updated example scene to demonstrate proper usage of the new HandleInput method

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ShapeEngine/Core/Scene.cs Added ResolveHandleInput() internal method and OnHandleInput() virtual method with comprehensive documentation
ShapeEngine/Core/GameDef/GameVirtual.cs Added protected virtual HandleInput() method with detailed XML documentation
ShapeEngine/Core/GameDef/GameResolve.cs Implemented ResolveHandleInput() method following the established pattern for event resolution
ShapeEngine/Core/GameDef/GameGameloop.cs Integrated ResolveHandleInput() call into the main game loop before update logic
ShapeEngine/Core/GameDef/GameCustomEvent.cs Replaced obsolete fixed update methods with new PreHandleInput() and PostHandleInput() hooks
Examples/Scenes/ExampleScene.cs Migrated input handling from OnUpdate() to the new OnHandleInput() method, demonstrating proper usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SoloByte SoloByte merged commit 24dcfc8 into main Jan 22, 2026
13 checks passed
@SoloByte SoloByte deleted the new-handle-input-loop branch January 22, 2026 07:25
@github-project-automation github-project-automation bot moved this from Review to Done in Shape Engine Roadmap Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

Add HandleInput Loop

2 participants