|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Gives a surface the color and the shadow that match its elevation level in the active theme. More...
#include <headers/guillaume/systems/surface_tone.hpp>


Public Member Functions | |
| SurfaceTone (void) | |
| Create the system in the Measure phase. | |
| ~SurfaceTone (void) override=default | |
| Destroy the system. It owns no resource. | |
| void | update (const ecs::Entity::Identifier &entityIdentifier) override |
| Write the color and the shadow of one surface for this frame. | |
| Public Member Functions inherited from guillaume::ecs::SystemFiller< components::SurfaceTone, components::Color, components::Elevation > | |
| SystemFiller (Phase phase) | |
| Create the system and set its signature from ComponentTypes. | |
| virtual | ~SystemFiller (void)=default |
| Virtual destructor. | |
| Public Member Functions inherited from guillaume::ecs::System | |
| System (Phase phase) | |
| Create a system that runs in a given phase, with an empty signature. | |
| virtual | ~System (void)=default |
| Virtual destructor. | |
| Phase | getPhase (void) const noexcept |
| Get the phase of the frame in which the system runs. | |
| Entity::Signature | getSignature (void) const noexcept |
| Get the component types an entity must declare to be visited by this system. | |
| void | routine (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry, const ecs::EntityTreeTraveler &traveler) |
| Run the system once over a scene: prepare(), update() on each matching entity, cleanup(). | |
| void | bindComponentRegistry (ecs::ComponentRegistry &componentRegistry) |
| Bind a component registry so update() can be called directly, without routine(). | |
| void | unbindComponentRegistry (void) |
| Drop the binding made by bindComponentRegistry(). | |
| virtual void | prepare (void) |
| Called once per pass, before the first update(). | |
| virtual void | cleanup (void) |
| Called once per pass, after the last update(). | |
Static Public Member Functions | |
| static void | apply (ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier) |
| Write the color and the shadow of one surface from its components::SurfaceTone. | |
Additional Inherited Members | |
| Protected Member Functions inherited from guillaume::ecs::System | |
| template<InheritFromComponent... ComponentTypes> | |
| void | setSignature (void) |
| Replace the signature by the one made of the given component types. | |
| ecs::EntityRegistry & | getEntityRegistry (void) |
| Get the entity registry of the scene being processed. | |
| const ecs::EntityRegistry & | getEntityRegistry (void) const |
| Get the entity registry of the scene being processed, read-only. | |
| ecs::ComponentRegistry & | getComponentRegistry (void) |
| Get the component registry of the scene being processed. | |
| const ecs::ComponentRegistry & | getComponentRegistry (void) const |
| Get the component registry of the scene being processed, read-only. | |
| template<InheritFromComponent ComponentType> | |
| bool | hasComponent (const ecs::Entity::Identifier &entityIdentifier) const |
| Tell whether an entity has a component, in the bound registry. | |
| template<InheritFromComponent ComponentType> | |
| ComponentType & | getComponent (const ecs::Entity::Identifier &entityIdentifier) |
| Get a component of an entity from the bound registry, to read or modify it. | |
| template<InheritFromComponent ComponentType> | |
| const ComponentType & | getComponent (const ecs::Entity::Identifier &entityIdentifier) const |
| Get a component of an entity from the bound registry, read-only. | |
| template<InheritFromComponent ComponentType> | |
| bool | requireComponent (const ecs::Entity::Identifier &entityIdentifier) |
| Tell whether an entity has a component, and log a warning naming the entity and the component when it does not. | |
Gives a surface the color and the shadow that match its elevation level in the active theme.
Runs in the Measure phase on entities with SurfaceTone, Color and Elevation.
Running in the Measure phase, ahead of the Render phase, means systems::RectangleRender and systems::ElevationRender draw the result in the same frame, and a change of theme reaches every surface on the next frame. Call apply() when the result is needed at once.
The Color and the Elevation of an entity that has a SurfaceTone are overwritten every frame: change the SurfaceTone, not them.
Definition at line 55 of file surface_tone.hpp.
| guillaume::systems::SurfaceTone::SurfaceTone | ( | void | ) |
Create the system in the Measure phase.
Definition at line 28 of file surface_tone.cpp.


|
static |
Write the color and the shadow of one surface from its components::SurfaceTone.
| componentRegistry | The registry holding the components. |
| entityIdentifier | The surface entity. It must have SurfaceTone, Color and Elevation. |
| ecs::EntityComponentNotFoundException | When one of the three components is missing. |
Definition at line 34 of file surface_tone.cpp.


|
overridevirtual |
Write the color and the shadow of one surface for this frame.
| entityIdentifier | The surface entity. It is skipped, with a log message, when one of the three components is missing. |
Implements guillaume::ecs::System.
Definition at line 51 of file surface_tone.cpp.
