# retroglyph - Complete API Documentation > A 2D pseudographic terminal library -- the consumer-facing facade over retroglyph-core and its backend/helper crates **Version:** 0.0.0 **Authors:** Matan Lurey **License:** MIT **Repository:** https://github.com/crates-lurey-io/retroglyph **Keywords:** roguelike, terminal, grid, gamedev Generated: 2026-08-23 16:09:34 UTC Created by: [cargo-llms-txt](https://github.com/masinc/cargo-llms-txt) ## Table of Contents ### src/prelude.rs - pub use crate::app::{App, Flow, Frame, Launch} - pub use crate::color::{Color, Style} - pub use crate::event::{Event, KeyCode} - pub use crate::grid::{HasSize, Pos, Rect, Size} - pub use crate::terminal::Terminal ### src/lib.rs - pub use retroglyph_core::{app, backend, color, event, frames, grid, layout, surface, symbols, terminal, text, tile} - pub use retroglyph_core::app::Launch - pub use retroglyph_core::testing::{RunError, TestHarness} - pub mod prelude - pub use retroglyph_crossterm as crossterm - pub use retroglyph_gl as gl - pub use retroglyph_software as software - pub use retroglyph_terminal_wasm as terminal_wasm - pub use retroglyph_ui as ui - pub use retroglyph_wgpu as wgpu - pub use retroglyph_window::presenter_builder::PresenterBuilder - pub use retroglyph_window::winit::{WindowConfig, Windowed, WindowedLaunchError, run_app, run_app_on} - pub fn run_default - pub fn run_default - pub fn run_default - pub fn run_default --- ## README.md ### retroglyph A 2D pseudographic terminal library -- the consumer-facing facade over retroglyph-core and its backend/helper crates Part of the [retroglyph](https://github.com/crates-lurey-io/retroglyph) workspace. --- ## src/prelude.rs ### crate::app::{App, Flow, Frame, Launch} ```rust pub use crate::app::{App, Flow, Frame, Launch}; ``` ### crate::color::{Color, Style} ```rust pub use crate::color::{Color, Style}; ``` ### crate::event::{Event, KeyCode} ```rust pub use crate::event::{Event, KeyCode}; ``` ### crate::grid::{HasSize, Pos, Rect, Size} ```rust pub use crate::grid::{HasSize, Pos, Rect, Size}; ``` ### crate::terminal::Terminal ```rust pub use crate::terminal::Terminal; ``` ## src/lib.rs ### retroglyph_core::{app, backend, color, event, frames, grid, layout, surface, symbols, terminal, text, tile} ```rust pub use retroglyph_core::{app, backend, color, event, frames, grid, layout, surface, symbols, terminal, text, tile}; ``` ### retroglyph_core::app::Launch ```rust pub use retroglyph_core::app::Launch; ``` The trait a backend's own builder implements to be driven end to end by [`launch`](Launch::launch): the user names the backend (`CrosstermOptions`, `Windowed`, ...) and gets back that backend's own unwrapped error, rather than a facade-wide one. See this trait's own docs for why there is no unified error here (`retroglyph::LaunchError`, tracked by #430, is only needed if the facade grows an entry point that can return either backend's error). ### retroglyph_core::testing::{RunError, TestHarness} ```rust pub use retroglyph_core::testing::{RunError, TestHarness}; ``` ### retroglyph_crossterm as crossterm ```rust pub use retroglyph_crossterm as crossterm; ``` A real-terminal [`Backend`](retroglyph_core::backend::Backend) via [`crossterm`](https://crates.io/crates/crossterm). ### retroglyph_gl as gl ```rust pub use retroglyph_gl as gl; ``` A GPU [`Backend`](retroglyph_core::backend::Backend) via [`glow`](https://crates.io/crates/glow): OpenGL 3.3 (native) and WebGL2 (wasm). ### retroglyph_software as software ```rust pub use retroglyph_software as software; ``` A CPU pixel [`Backend`](retroglyph_core::backend::Backend) via [`softbuffer`](https://crates.io/crates/softbuffer). ### retroglyph_terminal_wasm as terminal_wasm ```rust pub use retroglyph_terminal_wasm as terminal_wasm; ``` A browser [`Backend`](retroglyph_core::backend::Backend) driven by pushed/pulled ANSI I/O (e.g. [xterm.js](https://xtermjs.org/)). ### retroglyph_ui as ui ```rust pub use retroglyph_ui as ui; ``` The immediate-mode widget/layout toolkit: panels, gauges, tables, input/focus, theming, animation. ### retroglyph_wgpu as wgpu ```rust pub use retroglyph_wgpu as wgpu; ``` A GPU [`Backend`](retroglyph_core::backend::Backend) via [`wgpu`](https://crates.io/crates/wgpu): Vulkan, Metal, D3D12, and WebGPU. ### retroglyph_window::presenter_builder::PresenterBuilder ```rust pub use retroglyph_window::presenter_builder::PresenterBuilder; ``` ### retroglyph_window::winit::{WindowConfig, Windowed, WindowedLaunchError, run_app, run_app_on} ```rust pub use retroglyph_window::winit::{WindowConfig, Windowed, WindowedLaunchError, run_app, run_app_on}; ``` ### run_default ```rust pub fn run_default(app: A) -> Result<(), Launch::Error> where A: app::App + 'static ``` Picks a backend from this crate's enabled Cargo features and drives `app` on it, using that backend's own default configuration. See the priority order above. Each backend is built with [`PresenterBuilder::new()`] for a windowed backend, paced by [`RunOptions::default()`](app::RunOptions), or [`Crossterm::builder()`](crossterm::Crossterm::builder) for the terminal one. This is the zero-config fast path, not a general-purpose driver: an app that needs a specific grid size, window title, tileset, or pacing has outgrown "default" and should call that backend's own [`Launch::launch`] directly instead, e.g. `Windowed::new(builder, "My Game").launch(app, RunOptions::animated(60))` or `Crossterm::builder().launch(app, options)`. Absent entirely (not a compile error) when none of `crossterm`, `software`, `gl`, or `wgpu` is enabled: there is no backend left to pick. #### Errors Returns the picked backend's own [`Launch::Error`] if it fails to launch; see that backend's `Launch` impl for the exact conditions (a real terminal that can't enter raw mode, a presenter that fails to build, or a window/event loop that fails to start or run). ### run_default ```rust pub fn run_default(app: A) -> Result<(), Launch::Error> where A: app::App + 'static ``` See [`run_default`]'s `software`-enabled overload. `gl` is the other GPU windowed backend; `software` wins if both happen to be enabled. #### Errors See [`run_default`]'s `software`-enabled overload. ### run_default ```rust pub fn run_default(app: A) -> Result<(), Launch::Error> where A: app::App + 'static ``` See [`run_default`]'s `software`-enabled overload. `wgpu` is the other GPU windowed backend; it loses to `software`/`gl` if either is also enabled. #### Errors See [`run_default`]'s `software`-enabled overload. ### run_default ```rust pub fn run_default(app: A) -> Result<(), Launch::Error> where A: app::App + 'static ``` See [`run_default`]'s `software`-enabled overload. `crossterm` is the real-terminal backend; it loses to any windowed backend that's also enabled. #### Errors See [`run_default`]'s `software`-enabled overload. #### Examples ```no_run use retroglyph::crossterm::Crossterm; use retroglyph::prelude::*; struct Game; impl App for Game { fn update(&mut self, term: &mut Terminal, _frame: &Frame) -> Flow { term.surface().put((5, 5), '@', Style::new().fg(Color::GREEN)); Flow::Continue } } fn main() -> Result<(), std::io::Error> { retroglyph::run_default(Game) } ```