Entry point of the application.
More...
#include <application.hpp>
|
| Application (void) |
| Constructs an Application object.
|
|
| ~Application (void)=default |
| Destroys the Application object.
|
|
std::shared_ptr< RendererType > | getRenderer (void) const |
| Gets the renderer.
|
|
std::shared_ptr< Container > | getRoot (void) const |
| Gets the root container.
|
|
void | setRoot (std::shared_ptr< Container > root) |
| Sets the root container.
|
|
void | run (void) |
| Runs the application.
|
|
void | update (void) |
| Updates the application state.
|
|
void | stop (void) |
| Stop the application run loop (if managed externally).
|
|
|
void | drawTree (const std::shared_ptr< Component > &component) |
| Recursively draw the component tree using the renderer.
|
|
template<typename RendererType>
class Application< RendererType >
Entry point of the application.
The Application class holds the root component and manages the global lifecycle.
◆ drawTree()
template<typename RendererType >
Recursively draw the component tree using the renderer.
This walks the component hierarchy starting from the given component, draws all primitives in each component, and then recurses to children.
- Parameters
-
component | The starting component to draw |
◆ getRenderer()
template<typename RendererType >
std::shared_ptr< RendererType > Application< RendererType >::getRenderer |
( |
void |
| ) |
const |
|
inline |
Gets the renderer.
- Returns
- std::shared_ptr<RendererType> The renderer
◆ getRoot()
template<typename RendererType >
Gets the root container.
- Returns
- std::shared_ptr<Container> The root container
◆ run()
template<typename RendererType >
Runs the application.
This method starts the application lifecycle and performs a frame of the main loop using the renderer: clear, render, draw, and present. If you need continuous rendering, call this method in your own loop or extend it to manage events and timing.
◆ setRoot()
template<typename RendererType >
Sets the root container.
- Parameters
-
root | The new root container |
◆ update()
template<typename RendererType >
Updates the application state.
This method is called to update the application and trigger re-rendering.
The documentation for this class was generated from the following file: