gravita-renderer
Minimal CPU-based 2D rendering utilities.
Features
- Frame buffer rendering (works with any RGBA
&mut [u8]) - Drawing primitives: circles, lines, rectangles
- No GPU dependencies
- Suitable for prototyping and simple games
Usage
use ;
use Vec2;
// Create a frame buffer (800x600, RGBA)
let mut frame = vec!;
// Clear to dark blue
clear;
// Draw a white circle
draw_circle;
// Draw a red line
draw_line;
// Draw debug axes
draw_axes;
Coordinate System
The renderer works in screen coordinates where:
- Origin (0, 0) is at top-left
- X increases to the right
- Y increases downward
For physics integration, you typically need to flip Y:
let screen_y = screen_height - world_y;
License
MIT OR Apache-2.0