LiteFX::App::onBackendStart¶
Sets a callback that is called, if a backend is started.
Synopsis¶
Declared in <litefx/app.hpp>
template<typename TBackend>
requires meta::implements<TBackend, IBackend>
void onBackendStart(std::function<bool(TBackend*)> const& callback);
Description¶
A backend can have multiple start callbacks, that are executed if a backend is started. Typically such a callback is used to initialize a device and surface for an application. An application might use multiple callbacks, if it creates multiple devices, for example to create a plugin architecture.
Different to the backendStarted event, this event can be strongly typed at compile time, thus different callbacks can be provided per backend type without requiring to differentiate them at run-time.
Template Parameters¶
| Name | Description |
|---|---|
| TBackend | The type of the backend. |
Parameters¶
| Name | Description |
|---|---|
| callback | The function to call during backend startup. |
See Also¶
onBackendStop
backendStarted