package miaou-driver-matrix
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6
doc/miaou-driver-matrix.driver/Miaou_driver_matrix/Matrix_render_loop/index.html
Module Miaou_driver_matrix.Matrix_render_loopSource
Render loop for the Matrix driver.
Manages frame rendering in a dedicated OCaml 5 Domain for true parallelism. The render domain runs at configurable FPS, computing diffs between front/back buffers and emitting minimal ANSI sequences.
Architecture:
- Main domain: Input handling, state updates, writes to back buffer
- Render domain: Reads buffers, computes diff, writes via output sink
The buffer uses mutex synchronization for thread safety.
Render loop state.
val create :
config:Matrix_config.t ->
buffer:Matrix_buffer.t ->
writer:Matrix_ansi_writer.t ->
write:(string -> unit) ->
tCreate a new render loop (does not start the domain yet).
Request a frame to be rendered (legacy API, now no-op). The render domain automatically renders when buffer is dirty.
Render immediately if buffer is dirty. For use before domain starts or after shutdown. Returns true if a frame was rendered.
Get current achieved FPS - actual renders per second (for diagnostics). Thread-safe.
Get loop FPS - how fast the render loop is checking (the cap). Thread-safe.