feat(demo): add HUD effect, resize handling, and tests

- Add HUD effect plugin showing FPS, effect name, intensity bar, pipeline
- Add pygame window resize handling (VIDEORESIZE event)
- Move HUD to end of chain so it renders on top
- Fix monitor stats API (returns dict, not object)
- Add tests/test_hud.py for HUD effect verification
This commit is contained in:
2026-03-16 01:25:08 -07:00
parent 0152e32115
commit e1408dcf16
4 changed files with 141 additions and 5 deletions

View File

@@ -14,9 +14,11 @@ class HudEffect(EffectPlugin):
frame_time = 0.0
if monitor:
stats = monitor.get_stats()
if stats:
fps = stats.fps
frame_time = stats.avg_frame_time_ms
if stats and "pipeline" in stats:
frame_time = stats["pipeline"].get("avg_ms", 0.0)
frame_count = stats.get("frame_count", 0)
if frame_count > 0 and frame_time > 0:
fps = 1000.0 / frame_time
w = ctx.terminal_width
h = ctx.terminal_height