Graphics & rendering

AURA uses SDL3 for windows and input and Skia for 2D graphics and text. Its C++ scene graph connects layout, interaction, animation and media.

Graphics foundation

Structure

File Contents
application.h Window, GL context, Skia GPU surface, event and rendering loop, offscreen PNG
node.h Scene graph: Node, RectNode, ImageNode, SvgNode, TextNode, ScrollNode
layout.h QML-like anchors (place(node).left(44).below(title, 30)), gridCell for grids
animation.h Tweens with easing (Linear, InOutCubic, InOutQuint, OutQuad, OutBounce); bound to the target node, they stop when it is deleted
resources.h Cache for images, SVGs and application-provided fonts
video.h VideoPlayer (WebM/VP9, without audio, looping playlist) and VideoNode

Layout (aura/ui/layout.h)

QML anchors without bindings: a node is positioned once relative to its parent or a sibling node (same parent).

qml
Text title {
    text: "AURA"
    pixelSize: 28
    place: left 44, top 44
}
Text subtitle {
    text: "Application UI Runtime Architecture"
    pixelSize: 18
    place: left 44, below title 30
}
Call Meaning
left/right/top/bottom(m) Distance to the parent's edge (right/bottom require the node's own size)
centerX/centerY(offset), center() Centered in the parent, rounded to whole pixels like the old layouts
below/above/rightOf/leftOf(sibling, spacing) Next to a sibling node
alignLeft/alignTop/alignBottom(sibling), centerXOn/centerYOn(sibling) Aligned to a sibling node
size(w, h) Set size (especially before right, bottom, and center)

Background work

Text

Video

Offscreen screenshots

Application::renderToPng(root, width, height, file) renders a scene to PNG without a window. The Hello example and gallery provide command-line entry points:

bash
build/dev/examples/hello/aura-hello --render hello.png
build/dev/examples/demo/aura-demo --render-all /tmp/aura-gallery
build/dev/tools/aura-view/aura-view examples/hello --render /tmp/hello.png

See aura-view for preview galleries and Testing for visual comparisons.

Documentation source: docs/graphics.md Ā· Download Markdown

Search for topics, widgets or APIs.