|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
The entry point of a program: owns the engine, the scenes and the systems, and runs the frame loop. More...
#include <headers/guillaume/application.hpp>


Public Member Functions | |
| Application (std::shared_ptr< utility::RessourceProvider > ressourceProvider, std::unique_ptr< utility::Engine > engine) | |
| Build the application and enter the default scene. | |
| virtual | ~Application (void) |
| Destroy the application with its scenes, systems and engine. | |
| void | routine (void) |
| Run one frame. | |
| bool | shouldQuit (void) |
| Tell whether a quit event was received since the last call. | |
| int | run (void) |
| Run frames until a quit event is received. | |
Protected Member Functions | |
| std::shared_ptr< utility::RessourceProvider > | getRessourceProvider (void) |
| Get the resource provider given to the constructor. | |
The entry point of a program: owns the engine, the scenes and the systems, and runs the frame loop.
An application is declared with the list of its scene types. It creates one instance of each, enters the first one, and then repeats routine() until the engine reports a quit event. The engine (utility::Engine) is the platform layer the program provides: it opens the window or the XR session, draws, and reports input.
A minimal program:
One frame (routine()), in order:
Things to watch out for:
| DefaultSceneType | The scene activated when the application starts. |
| SceneTypes | The other scenes of the application. Every scene type must inherit from Scene, appear only once, and be constructible from the arguments of the Scene constructor. |
Definition at line 133 of file application.hpp.
| guillaume::Application< DefaultSceneType, SceneTypes >::Application | ( | std::shared_ptr< utility::RessourceProvider > | ressourceProvider, |
| std::unique_ptr< utility::Engine > | engine ) |
Build the application and enter the default scene.
In order: registers the core systems (systems::registerCoreSystems), routes the engine's events to the event bus, creates one instance of every scene type, then calls onEnter() on the default scene and places its root entities in front of the engine's view.
| ressourceProvider | Gives access to the files the systems and the scenes load (fonts, images, meshes). Shared with them. |
| engine | The engine that renders and polls events. The application takes ownership. |
| std::invalid_argument | When the engine is null. |
|
inlineprotected |
Get the resource provider given to the constructor.
Definition at line 199 of file application.hpp.
| void guillaume::Application< DefaultSceneType, SceneTypes >::routine | ( | void | ) |
Run one frame.
Polls the engine's events, clears and updates the engine, runs the Event, Measure, Layout and Render phases on the active scene, resets the changed flags of its components, carries out a pending scene switch and presents the frame. See the class description.
run() calls it in a loop; call it directly to drive the loop from outside. Exceptions thrown by a system, a handler or a scene switch to an unknown scene propagate to the caller.
| int guillaume::Application< DefaultSceneType, SceneTypes >::run | ( | void | ) |
Run frames until a quit event is received.
| bool guillaume::Application< DefaultSceneType, SceneTypes >::shouldQuit | ( | void | ) |
Tell whether a quit event was received since the last call.
The pending quit event is consumed: a second call returns false until the engine reports another one.