LiteFX 0.4.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
LiteFX::Rendering::IRenderBackend Class Referenceabstract

The interface to access a render backend. More...

#include <rendering_api.hpp>

Inherits LiteFX::IBackend.

Inherited by LiteFX::Rendering::RenderBackend< DirectX12Device >, LiteFX::Rendering::RenderBackend< VulkanDevice >, and LiteFX::Rendering::RenderBackend< TGraphicsDevice >.

Public Member Functions

 ~IRenderBackend () noexcept override=default
 
Enumerable< SharedPtr< const IGraphicsAdapter > > listAdapters () const
 Lists all available graphics adapters.
 
virtual const IGraphicsAdapterfindAdapter (const Optional< UInt64 > &adapterId=std::nullopt) const noexcept=0
 Finds an adapter using its unique ID.
 
virtual IGraphicsDevicedevice (const String &name) noexcept=0
 Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could be found.
 
virtual const IGraphicsDevicedevice (const String &name) const noexcept=0
 Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could be found.
 
virtual const IGraphicsDeviceoperator[] (const String &name) const noexcept
 Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could be found.
 
virtual IGraphicsDeviceoperator[] (const String &name) noexcept
 Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could be found.
 
- Public Member Functions inherited from LiteFX::IBackend
virtual ~IBackend () noexcept=default
 
virtual BackendType type () const noexcept=0
 Gets the type of the backend.
 
const BackendStatestate () const noexcept
 Returns the state of the backend.
 
virtual StringView name () const noexcept=0
 Gets the name of the backend.
 

Protected Member Functions

 IRenderBackend () noexcept=default
 
 IRenderBackend (IRenderBackend &&) noexcept=default
 
 IRenderBackend (const IRenderBackend &)=default
 
IRenderBackendoperator= (const IRenderBackend &)=default
 
IRenderBackendoperator= (IRenderBackend &&) noexcept=default
 
- Protected Member Functions inherited from LiteFX::IBackend
 IBackend () noexcept=default
 
 IBackend (const IBackend &)=default
 
 IBackend (IBackend &&) noexcept=default
 
IBackendoperator= (const IBackend &)=default
 
IBackendoperator= (IBackend &&) noexcept=default
 
BackendStatestate () noexcept
 Returns the state of the backend.
 
virtual void activate ()=0
 Called by the parent App, if the backend is started.
 
virtual void deactivate ()=0
 Called by the parent App, if the backend is stopped.
 

Detailed Description

The interface to access a render backend.

Constructor & Destructor Documentation

◆ IRenderBackend() [1/3]

LiteFX::Rendering::IRenderBackend::IRenderBackend ( )
protecteddefaultnoexcept

◆ IRenderBackend() [2/3]

LiteFX::Rendering::IRenderBackend::IRenderBackend ( IRenderBackend && )
protecteddefaultnoexcept

◆ IRenderBackend() [3/3]

LiteFX::Rendering::IRenderBackend::IRenderBackend ( const IRenderBackend & )
protecteddefault

◆ ~IRenderBackend()

LiteFX::Rendering::IRenderBackend::~IRenderBackend ( )
overridedefaultnoexcept

Member Function Documentation

◆ device() [1/2]

virtual const IGraphicsDevice * LiteFX::Rendering::IRenderBackend::device ( const String & name) const
pure virtualnoexcept

Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could be found.

Parameters
nameThe name of the device.
Returns
A pointer to the device or nullptr, if no device could be found.

Implemented in LiteFX::Rendering::Backends::DirectX12Backend, LiteFX::Rendering::Backends::VulkanBackend, LiteFX::Rendering::RenderBackend< TGraphicsDevice >, LiteFX::Rendering::RenderBackend< DirectX12Device >, and LiteFX::Rendering::RenderBackend< VulkanDevice >.

◆ device() [2/2]

virtual IGraphicsDevice * LiteFX::Rendering::IRenderBackend::device ( const String & name)
pure virtualnoexcept

Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could be found.

Parameters
nameThe name of the device.
Returns
A pointer to the device or nullptr, if no device could be found.

Implemented in LiteFX::Rendering::Backends::DirectX12Backend, LiteFX::Rendering::Backends::VulkanBackend, LiteFX::Rendering::RenderBackend< TGraphicsDevice >, LiteFX::Rendering::RenderBackend< DirectX12Device >, and LiteFX::Rendering::RenderBackend< VulkanDevice >.

◆ findAdapter()

virtual const IGraphicsAdapter * LiteFX::Rendering::IRenderBackend::findAdapter ( const Optional< UInt64 > & adapterId = std::nullopt) const
pure virtualnoexcept

Finds an adapter using its unique ID.

Note that the adapter ID is optional, which allows the back-end to return a default adapter instance. Which adapter is used as default adapter, depends on the actual back-end implementation. The interface does not make any constraints on the default adapter to choose. A naive implementation might simply return the first available adapter.

Parameters
adapterIdThe unique ID of the adapter, or std::nullopt to find the default adapter.
Returns
A pointer to a graphics adapter, or nullptr, if no adapter could be found.
See also
IGraphicsAdapter

Implemented in LiteFX::Rendering::Backends::DirectX12Backend, LiteFX::Rendering::Backends::VulkanBackend, LiteFX::Rendering::RenderBackend< TGraphicsDevice >, LiteFX::Rendering::RenderBackend< DirectX12Device >, and LiteFX::Rendering::RenderBackend< VulkanDevice >.

◆ listAdapters()

Enumerable< SharedPtr< const IGraphicsAdapter > > LiteFX::Rendering::IRenderBackend::listAdapters ( ) const
inline

Lists all available graphics adapters.

Returns
An array of pointers to all available graphics adapters.

◆ operator=() [1/2]

IRenderBackend & LiteFX::Rendering::IRenderBackend::operator= ( const IRenderBackend & )
protecteddefault

◆ operator=() [2/2]

IRenderBackend & LiteFX::Rendering::IRenderBackend::operator= ( IRenderBackend && )
protecteddefaultnoexcept

◆ operator[]() [1/2]

virtual const IGraphicsDevice * LiteFX::Rendering::IRenderBackend::operator[] ( const String & name) const
inlinevirtualnoexcept

Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could be found.

Parameters
nameThe name of the device.
Returns
A pointer to the device or nullptr, if no device could be found.

Reimplemented in LiteFX::Rendering::RenderBackend< TGraphicsDevice >, LiteFX::Rendering::RenderBackend< DirectX12Device >, and LiteFX::Rendering::RenderBackend< VulkanDevice >.

◆ operator[]() [2/2]

virtual IGraphicsDevice * LiteFX::Rendering::IRenderBackend::operator[] ( const String & name)
inlinevirtualnoexcept

Looks up a device and returns a pointer to it, or nullptr, if no device with the provided name could be found.

Parameters
nameThe name of the device.
Returns
A pointer to the device or nullptr, if no device could be found.

Reimplemented in LiteFX::Rendering::RenderBackend< TGraphicsDevice >, LiteFX::Rendering::RenderBackend< DirectX12Device >, and LiteFX::Rendering::RenderBackend< VulkanDevice >.