Skip to main content

agg_gui/gl_renderer/
mod.rs

1//! GL renderer infrastructure — tess2 bridge + GL command buffer.
2//!
3//! This module provides the building blocks for hardware-accelerated rendering:
4//!
5//! - [`tess2_bridge`] — converts AGG-style polygon contours into GL triangle
6//!   meshes using tess2-rust.
7//!
8//! The higher-level [`GlGfxCtx`] (a drop-in parallel to [`crate::GfxCtx`] for
9//! GL targets) and the full [`RenderTarget`] abstraction are planned extensions.
10//!
11//! # Reference
12//!
13//! Modelled after the MatterCAD agg-sharp `Graphics2DGpu` / `AARenderTesselator`
14//! pipeline: shapes are tessellated to triangle meshes, then uploaded as VBOs
15//! and rendered with a simple colour-fill shader.  Anti-aliased edge expansion
16//! (one-pixel outward quad + coverage ramp) follows `AARenderTesselator.cs`.
17
18pub mod glyph_cache;
19pub mod tess2_bridge;
20
21pub use glyph_cache::GlyphCache;
22pub use tess2_bridge::{
23    agg_path_to_contours, expand_aa_halo, tessellate_circle, tessellate_fill, tessellate_interior,
24    tessellate_path, tessellate_path_aa, tessellate_rect, tessellate_rounded_rect, CachedTess,
25};