optic_render/lib.rs
1//! GPU-accelerated rendering with EGL/OpenGL 4.6.
2//!
3//! `optic-render` manages the full graphics pipeline: context creation (headless or
4//! windowed), asset loading (meshes, textures, shaders), instanced drawing, off-screen
5//! canvas (framebuffer objects), and 2D/3D camera transforms.
6//!
7//! # Architecture
8//!
9//! | Layer | Module | Role |
10//! |-------|--------|------|
11//! | Context | [`RenderContext`] | EGL display, surfaces, vsync |
12//! | Backend | [`GL`] | Thin wrappers around raw OpenGL calls |
13//! | Device | [`GPU`] | Stateful renderer with fallback assets |
14//! | Assets | [`asset`] | Load/save/cache meshes, textures, shaders from disk |
15//! | Handles | [`handles`] | Runtime GPU handles: [`MeshHandle`], [`Shader`], [`Texture2D`], [`Canvas`], [`InstanceBuffer`] ... |
16//! | Camera | [`Camera`] | Perspective/orthographic camera with fly-through controls |
17//! | Transforms | [`Transform2D`], [`Transform3D`], [`CamTransform`] | Position / rotation / scale helpers |
18//!
19//! # Getting started
20//!
21//! ```ignore
22//! use optic_render::GPU;
23//!
24//! let gpu = GPU::new_headless()?;
25//! println!("{}", gpu.version());
26//! ```
27//!
28//! # Feature flags
29//!
30//! This crate is always compiled with all features. The parent `optic` crate controls
31//! which sub-crates are included via its own feature flags.
32
33mod camera;
34mod context;
35mod glraw;
36mod handles;
37mod renderer;
38mod util;
39
40pub mod asset;
41
42pub use camera::*;
43pub use context::*;
44pub use glraw::*;
45pub use handles::*;
46pub use renderer::*;
47pub use util::*;