retrofire_core/lib.rs
1//! ```text
2//! ______
3//! ___ /´ ____/\
4//! __ ______ _____ / /\_ _ ______ _____ __ / /_/___/\ __ _____ ______
5//! ==/ ´ ____/ __ \ ____/ ´ ____/ __ ` __ ___, /==/ ´ ___/ __ \
6//! ==/ /´=/ ______/ /==/ /´=/ /==/ /=/ /=/ /==/ /´=/ ______/\
7//! ==/ /==/ /____/ /__/ /==/ /__/ /=/ /=/ /__/ /==/ /______\/
8//! ==/___/ ==\_______/\______/__/ ==\________,´_/ /==\______/__/ ==\________/\
9//! ==\___\/ ==\______\/\_____\__\/ ==\______/_____,´ /==\_____\___\/==\_______\/
10//! \_____\,´
11//! ```
12//!
13//! Core functionality of the `retrofire` project.
14//!
15//! Includes a math library with vectors, matrices, colors, and angles; basic
16//! geometry primitives; a software 3D renderer with customizable shaders;
17//! with more to come.
18//!
19//! # Crate features
20//!
21//! * `std`:
22//! Makes available items requiring I/O, timekeeping, or any floating-point
23//! functions not included in `core`. In particular this means trigonometric
24//! and transcendental functions.
25//!
26//! If this feature is disabled, the crate only depends on `alloc`.
27//!
28//! * `libm`:
29//! Provides software implementations of floating-point functions via the
30//! [libm](https://crates.io/crates/libm) crate.
31//!
32//! * `mm`:
33//! Provides fast approximate implementations of floating-point functions
34//! via the [micromath](https://crates.io/crates/micromath) crate.
35//!
36//! All features are disabled by default.
37//!
38//! # Example
39//!
40//! ```
41#![doc = include_str!("../examples/hello_tri.rs")]
42//! ```
43
44#![no_std]
45
46#[cfg(feature = "std")]
47extern crate std;
48
49// TODO make alloc optional
50extern crate alloc;
51extern crate core;
52
53pub mod geom;
54pub mod math;
55pub mod render;
56pub mod util;
57
58/// Prelude module exporting many frequently used items.
59pub mod prelude {
60 pub use crate::{
61 geom::{
62 Mesh, Normal2, Normal3, Tri, Vertex, Vertex2, Vertex3, tri, vertex,
63 },
64 math::*,
65 render::{raster::Frag, *},
66 util::buf::{AsMutSlice2, AsSlice2, Buf2, MutSlice2, Slice2},
67 };
68}