Skip to content

11 the master game loop#21

Merged
LyeZinho merged 3 commits intomainfrom
11-the-master-game-loop
Apr 14, 2026
Merged

11 the master game loop#21
LyeZinho merged 3 commits intomainfrom
11-the-master-game-loop

Conversation

@LyeZinho
Copy link
Copy Markdown
Member

Done

Cherry-pick Timer implementation (TimePoint, Duration, Timer, ScopeTimer)
with 31 passing tests. Required dependency for GameLoop.
…attern (RF2.7, RF2.8)

- Add GameState enum (Init/Running/Paused/Shutdown) with correct transitions
- Add GameLoopConfig with fixedDeltaTime, maxFrameTime, vsync, interpolation
- Add IGameCallbacks virtual interface for extensible game hooks
- Support both std::function callbacks and IGameCallbacks interface
- Implement fixed timestep accumulator with spiral-of-death prevention
- Calculate interpolation alpha in [0, 1) for smooth rendering
- Paused state skips fixed update but continues rendering
- Convert Caffeine library from INTERFACE to static for .cpp compilation
- Add comprehensive test suite (27 tests) covering:
  - State machine transitions
  - Accumulator math and fixed update rate
  - Spiral of death clamping
  - Interpolation alpha bounds
  - Callback invocation (both mechanisms)
  - 3600-frame deterministic accumulation
@LyeZinho LyeZinho linked an issue Apr 14, 2026 that may be closed by this pull request
@LyeZinho LyeZinho added enhancement New feature or request planned-implementation Implementations planned according with roadmap labels Apr 14, 2026
@LyeZinho LyeZinho self-assigned this Apr 14, 2026
# Conflicts:
#	CMakeLists.txt
#	tests/CMakeLists.txt
@LyeZinho LyeZinho merged commit ee19801 into main Apr 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request planned-implementation Implementations planned according with roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The Master Game Loop

1 participant