optic_core/lib.rs
1//! Shared types, geometry, errors, constants, and logging for the Optic engine.
2//!
3//! This crate is the foundation of the engine. Every other crate depends on it.
4//! It re-exports [`optic_color`] and [`cgmath`], so downstream crates get math
5//! and color types through a single dependency.
6//!
7//! # Organization
8//!
9//! | Module | Contents |
10//! |--------|----------|
11//! | [`geometry`] | [`Size2D`], [`Size3D`], [`ClipDist`], [`CamProj`], [`Components`] trait |
12//! | [`coord`] | [`Coord2D`] (point), [`CoordOffset`] (vector/displacement) |
13//! | [`enums`] | [`PolyMode`], [`Cull`], [`DrawMode`], [`ImgFormat`], [`ImgFilter`], [`ImgWrap`], [`ATTRType`] |
14//! | [`error`] | [`OpticError`], [`OpticErrorKind`], [`OpticResult`] |
15//! | [`ansi`] | [`ANSI`] color codes for terminal output |
16//! | [`consts`] | Asset paths, cache magic, version constants |
17//! | [`network`] | [`PeerId`], [`NetworkMode`], [`NetworkConfig`], [`NetworkEvents`] |
18//! | [`proc`] | [`end`], [`end_success`], [`end_error`] process helpers |
19//!
20//! # Logging macros
21//!
22//! The crate provides color-coded logging via macro:
23//!
24//! ```
25//! use optic_core::*;
26//!
27//! log_info!("hello world");
28//! log_warn!("value is {}", 42);
29//! log_error!("something broke");
30//! log_color!("custom format", RED, "arg {}", 1);
31//! ```
32
33pub mod ansi;
34mod color;
35pub mod consts;
36mod coord;
37mod enums;
38mod error;
39mod geometry;
40mod log;
41pub mod network;
42mod proc;
43
44pub use color::*;
45pub use coord::*;
46pub use enums::*;
47pub use error::*;
48pub use geometry::*;
49pub use network::*;
50pub use proc::*;
51
52pub use cgmath;