forked from genewildish/Mainline
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user