LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::IBackend Class Referenceabstract

The base class for an app backend. More...

#include <app.hpp>

Inherited by LiteFX::Rendering::IRenderBackend.

Public Member Functions

virtual ~IBackend () noexcept=default
 
virtual BackendType type () const noexcept=0
 Gets the type of the backend. More...
 
const BackendState & state () const noexcept
 Returns the state of the backend. More...
 
virtual String name () const noexcept=0
 Gets the name of the backend. More...
 

Protected Member Functions

BackendState & state () noexcept
 Returns the state of the backend. More...
 
virtual void activate ()=0
 Called by the parent App, if the backend is started. More...
 
virtual void deactivate ()=0
 Called by the parent App, if the backend is stopped. More...
 

Friends

class App
 

Detailed Description

The base class for an app backend.

An App can have one or more backends configured per BackendType. However, only one backend of a specific backend type can be active at a time. Backends can be configured with a startup and shutdown callback. Starting a backend will automatically shutdown the active backend of the same type, if any. If the app exits, all backends are shutdown accordingly, allowing to properly cleanup any resources.

See also
App

Constructor & Destructor Documentation

◆ ~IBackend()

virtual LiteFX::IBackend::~IBackend ( )
virtualdefaultnoexcept

Member Function Documentation

◆ activate()

virtual void LiteFX::IBackend::activate ( )
protectedpure virtual

Called by the parent App, if the backend is started.

Implemented in LiteFX::Rendering::Backends::DirectX12Backend, and LiteFX::Rendering::Backends::VulkanBackend.

◆ deactivate()

virtual void LiteFX::IBackend::deactivate ( )
protectedpure virtual

Called by the parent App, if the backend is stopped.

Implemented in LiteFX::Rendering::Backends::DirectX12Backend, and LiteFX::Rendering::Backends::VulkanBackend.

◆ name()

virtual String LiteFX::IBackend::name ( ) const
pure virtualnoexcept

Gets the name of the backend.

Returns
The name of the backend.

Implemented in LiteFX::Rendering::Backends::DirectX12Backend, and LiteFX::Rendering::Backends::VulkanBackend.

◆ state() [1/2]

const BackendState & LiteFX::IBackend::state ( ) const
inlinenoexcept

Returns the state of the backend.

Returns
The state of the backend.
See also
BackendState

◆ state() [2/2]

BackendState & LiteFX::IBackend::state ( )
inlineprotectednoexcept

Returns the state of the backend.

Returns
The state of the backend.

◆ type()

virtual BackendType LiteFX::IBackend::type ( ) const
pure virtualnoexcept

Gets the type of the backend.

Returns
The type of the backend.
See also
BackendType

Implemented in LiteFX::Rendering::Backends::DirectX12Backend, and LiteFX::Rendering::Backends::VulkanBackend.

Friends And Related Function Documentation

◆ App

friend class App
friend