zcatgui/src
reugenio 80b5d99bfd feat(core): Add MainLoop helper for optimized application loops
MainLoop encapsulates the CPU optimization patterns:
- Progressive sleep (8ms → 33ms → SDL_WaitEventTimeout)
- Automatic event handling
- Dirty region support
- Configurable timing parameters

Usage:
```zig
const MyApp = struct {
    pub fn handleEvent(self: *MyApp, event: Event, ctx: *Context) void { ... }
    pub fn update(self: *MyApp, ctx: *Context) bool { return changed; }
    pub fn draw(self: *MyApp, ctx: *Context, renderer: *Renderer) void { ... }
};

var loop = try MainLoop.init(allocator, 800, 600);
loop.run(backend, &app);
```

This moves CPU optimization from application code to library level,
making it easy for all zcatgui apps to achieve 0% CPU in idle.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 12:25:27 +01:00
..
backend feat(backend): Add waitEvent and waitEventTimeout for 0% CPU idle 2025-12-10 12:06:45 +01:00
core feat(core): Add MainLoop helper for optimized application loops 2025-12-10 12:25:27 +01:00
macro style: Use consistent lowercase naming (zcatgui, not zCatGui) 2025-12-09 01:38:36 +01:00
panels feat: zcatgui v0.6.0 - Phase 1 Optimization Complete 2025-12-09 12:45:00 +01:00
render perf(framebuffer): Optimize fillRect with row-wise @memset 2025-12-10 12:18:47 +01:00
utils feat: zcatgui v0.14.0 - Phase 8 Accessibility & Testing 2025-12-09 13:54:07 +01:00
widgets feat(TextInput): Manejar teclas especiales internamente 2025-12-10 01:39:26 +01:00
zcatgui.zig feat(core): Add MainLoop helper for optimized application loops 2025-12-10 12:25:27 +01:00