$ show not-fl3/macroquad
macroquad is a Rust game engine and graphics library inspired by raylib, providing a simple, immediate-mode API for 2D and 3D rendering, audio, input handling, and UI. The codebase is structured as a monolithic core library with several subcrates (particles, tiled, profiler, physics-platformer, macroquad_macro) that add specialized functionality. The architecture centers on a single-threaded game loop orchestrated by the `#[macroquad::main]` proc macro, with drawing batched via an internal OpenGL abstraction (miniquad). Key data flows include texture and font loading, immediate-mode UI widget rendering, and an experimental scene/coroutine system for game logic. The library is cross-platform (Windows, Linux, macOS, Web, Android, iOS) and emphasizes minimal dependencies and ease of use. While the core is tightly coupled, several subcrates and subsystems are well-encapsulated and demonstrate high craftsmanship.
The LLM identified 6 files worth highlighting for reuse:
A GPU-based particle system with configurable emitters, shape types, blend modes, atlas animation, and lifetime curves. Self-contained crate with its own shader and minimal macroquad dependencies. Demonstrates non-obvious skill in offloading particle simulation to the GPU and providing a flexible, reusable API.
A real-time profiler overlay that displays FPS, frame time graph, zone timing, and GPU query results. Self-contained crate that draws its own UI using macroquad primitives. Easily integrable into any macroquad project and demonstrates clean separation of profiling logic from application code.
A Tiled JSON map loader and renderer supporting tilesets, layers, objects, and image layers. Isolated crate that depends only on macroquad for rendering. Well-structured parsing with error handling and flip flag support. Demonstrates a clean pattern for loading external data formats into game engine renderables.
A complete immediate-mode UI subsystem with widgets (button, editbox, combobox, slider, window, etc.), styling via Skin/StyleBuilder, and a painter abstraction that translates high-level draw commands into meshes. Demonstrates a sophisticated, self-contained UI framework within a game engine, with features like undo/redo in text editor and event routing.
An experimental ECS-like scene system with arena allocation, type-erased nodes, handles with generation IDs, and lifecycle methods (ready, update, fixed_update, draw). Demonstrates advanced memory management patterns and a flexible node-based architecture. Though marked experimental, it showcases non-obvious skill in game object management.
A coroutine system for asynchronous game logic (delays, tweens, sequencing) without relying on an external async runtime. Uses generator-like state machines with manual resume/pause. Demonstrates a unique pattern for handling game time and sequencing within a single-threaded game loop.