Raxol.Core.Renderer.Buffer (Raxol v0.5.0)
View SourceManages terminal buffer rendering with double buffering and damage tracking.
This module provides efficient terminal rendering by:
- Using double buffering to prevent screen flicker
- Tracking damaged regions to minimize updates
- Supporting partial screen updates
- Managing frame timing
Summary
Functions
Clears the entire buffer and marks all cells as damaged.
Gets the damaged regions that need to be redrawn. Returns a list of {position, cell} tuples.
Creates a new buffer manager with the given size and FPS.
Updates a cell in the back buffer and marks it as damaged.
Resizes the buffer to the new dimensions. Preserves content where possible and marks all changed cells as damaged.
Swaps the front and back buffers if enough time has passed since the last frame. Returns {buffer, should_render}, where should_render indicates if a new frame should be drawn.
Types
@type position() :: {non_neg_integer(), non_neg_integer()}
@type size() :: {non_neg_integer(), non_neg_integer()}
Functions
Clears the entire buffer and marks all cells as damaged.
Gets the damaged regions that need to be redrawn. Returns a list of {position, cell} tuples.
Creates a new buffer manager with the given size and FPS.
Updates a cell in the back buffer and marks it as damaged.
Resizes the buffer to the new dimensions. Preserves content where possible and marks all changed cells as damaged.
Swaps the front and back buffers if enough time has passed since the last frame. Returns {buffer, should_render}, where should_render indicates if a new frame should be drawn.