Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
RetainedText.hpp File Reference

Glyph geometry the engine keeps between frames, and the clipping of it against a view. More...

#include "./TextVertexFormat.hpp"
#include "../../core/Types.hpp"
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
Include dependency graph for RetainedText.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  esengine::RetainedTextBatch
struct  esengine::RetainedText
class  esengine::RetainedTextStore
 The retained geometry of every label, by entity. Ordered: a frame submits in entity order, not in whatever order a hash left them. More...
struct  esengine::RetainedTextClip
 Where the quads a view keeps are copied to, reused across batches and frames. More...

Namespaces

namespace  esengine

Enumerations

enum class  esengine::RetainedTextKept { esengine::None , esengine::All , esengine::Subset }
 What a view keeps of a batch: nothing, all of it (read the batch itself), or a subset copied into scratch. More...

Functions

bool esengine::retainedTextAutoIsSdf (f32 worldScaleX)
bool esengine::retainedTextClipPlanes (double *out, const f32 *view, const f32 *model)
int esengine::retainedTextClassify (const double *planes, double left, double bottom, double right, double top)
 0 outside, 1 inside, 2 crossing a clip plane. Non-finite bounds stay visible.
RetainedTextKept esengine::retainedTextClip (const RetainedTextBatch &batch, const double *planes, RetainedTextClip &scratch)

Variables

constexpr u32 esengine::RETAINED_TEXT_BLOCK_QUADS = 64
 Quads in one bounds block: a view that misses the whole block does not look at its quads.
constexpr u32 esengine::RETAINED_TEXT_QUAD_FLOATS = 4 * TEXT_VERTEX_FLOATS

Detailed Description

Glyph geometry the engine keeps between frames, and the clipping of it against a view.

The text system lays a label out in TS (it rasterizes glyphs through a canvas) and used to hand the quads back to the engine every frame, with the label's matrix, opacity, order and clip all asked of the engine one embind call at a time. A label that has not changed is the same quads next frame, so TS now hands them over once and the engine submits them itself, reading what it needs of the entity from the registry. TS comes back only for a label whose text, style or box changed.

Definition in file RetainedText.hpp.