Paint.h file
Paint: turning a published document into draw data.
Everything the UI draws is a UIPrimitive: a quad with rounded corners, a border, a colour, a texture region, and a clip. Screen UI writes primitives on the CPU when a snapshot is published; world UI and sprites write the same structure from compute. The GPU pass and the reference rasterizer draw nothing else.
A node's appearance comes from its style class: a PaintStyle resolved from a StyleTable.
Namespaces
- namespace GGUI
Classes
- struct GGUI::GGColor
- sRGB, straight alpha.
- struct GGUI::PaintStyle
- The resolved appearance of a style class. Layout props are not here; they are the builder's.
- struct GGUI::GGSheetError
- A style sheet parse error.
- struct GGUI::GGStyleOrigin
- One resolved property and the rule it came from. For tools.
- struct GGUI::GGTokenInfo
- A token's current value. For tools.
- struct GGUI::GGStyle
- A rule's properties. Only the ones it sets apply (see UIStyle.h).
- struct GGUI::GGStyleScope
- Rules and tokens that reach only the elements carrying a scope class: a widget asset's styles, the tokens a use gives it, or tokens set in code (ui.Tokens).
- struct GGUI::GGTokenSet
- A token given a value for everything one element builds (ui.Tokens, UseProps::
Tokens): { "bar-fill", GGColor::Hex(0x4C8DFFFF) },{ "bar-radius", 3.0f }, or another token's value,GGTokenSet::.Alias("bar-fill", "danger") - struct GGUI::GGLiveToken
- A token that follows game data: the binding's number, or for a choice IfTrue while the binding is non-zero and IfFalse otherwise (a token written
"=select(Player.CHealth.Low, '@danger', '@ok')"). - class GGUI::GGStyleScopes
- A set of style scopes, found by class. Touch it when a scope's sheet changes in place.
- class GGUI::GGLooks
- GGLooks: a per-document cache of resolved styles.
- class GGUI::StyleTable
- StyleTable: tokens and layered rules.
- struct GGUI::UIPrimitive
- UIPrimitive: one instanced quad. 48 bytes; the layout is shared with the shaders.
- struct GGUI::UIClip
- One clip table entry: a document-space rect plus an offset applied to everything drawn under it.
- struct GGUI::GlyphQuad
- One glyph to draw: where it goes, and where it is in the atlas.
- struct GGUI::TextPiece
- Where part of a span was put: one per line it is on. Relative to the text's top left, UI units; as high as a line of its font, and as wide as its glyphs and padding, or its box.
- class GGUI::GlyphVisitor
- Non-owning callable taking a glyph quad. Called during the call it is passed to, never stored.
- struct GGUI::GlyphSource
- Where paint gets the glyphs of shaped text. The text engine supplies one.
- struct GGUI::ImageInfo
- What an image is: its texture, its region within it, and its size.
- struct GGUI::ImageSource
- Issues and describes images. Set on a document by the host.
- struct GGUI::PaintStats
- What one paint did.
- struct GGUI::PrimitiveRange
- A run of primitive slots (GGSnapshot::
Primitives). - struct GGUI::PaintDelta
- What changed between one snapshot's primitives and the next, so a consumer keeping a copy (a GPU buffer) can update it incrementally.
- struct GGUI::PaintLayer
- Another document's primitives drawn over this one at (X, Y): a popup layer.
- struct GGUI::PaintNested
- A document drawn inside a node of this one (ui.Document): its primitives are the node's, at Box corner + (X, Y) + Zoom * position, under clips made from its own within the node's.
- struct GGUI::PaintState
- PaintState: slot bookkeeping carried from one paint of a document to the next.
- struct GGUI::PaintState::View
- Accumulated scroll offset, zoom, and group transform, and the visible region, for a node's content (GGSnapshot::
View). - struct GGUI::PaintState::NestedClips
- The clip entries a node showing a document inside (PaintNested) keeps: one for the document's unclipped primitives, then one per clip of its own.