LiteFX 0.3.1.2022
Computer Graphics Engine
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< DirectX12Backend, DirectX12Device >, LiteFX::Rendering::RenderBackend< VulkanBackend, VulkanDevice >, and LiteFX::Rendering::RenderBackend< TBackend, TGraphicsDevice >.

Public Member Functions

virtual ~IRenderBackend () noexcept=default
 
Array< const IGraphicsAdapter * > listAdapters () const
 Lists all available graphics adapters. More...
 
virtual const IGraphicsAdapterfindAdapter (const Optional< UInt64 > &adapterId=std::nullopt) const =0
 Finds an adapter using its unique ID. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from LiteFX::IBackend
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...
 

Additional Inherited Members

- Protected Member Functions inherited from LiteFX::IBackend
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...
 

Detailed Description

The interface to access a render backend.

Constructor & Destructor Documentation

◆ ~IRenderBackend()

virtual LiteFX::Rendering::IRenderBackend::~IRenderBackend ( )
virtualdefaultnoexcept

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< TBackend, TGraphicsDevice >, LiteFX::Rendering::RenderBackend< DirectX12Backend, DirectX12Device >, and LiteFX::Rendering::RenderBackend< VulkanBackend, 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< TBackend, TGraphicsDevice >, LiteFX::Rendering::RenderBackend< DirectX12Backend, DirectX12Device >, and LiteFX::Rendering::RenderBackend< VulkanBackend, VulkanDevice >.

◆ findAdapter()

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

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::RenderBackend< TBackend, TGraphicsDevice >, LiteFX::Rendering::Backends::DirectX12Backend, LiteFX::Rendering::Backends::VulkanBackend, LiteFX::Rendering::RenderBackend< DirectX12Backend, DirectX12Device >, and LiteFX::Rendering::RenderBackend< VulkanBackend, VulkanDevice >.

◆ listAdapters()

Array< 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]

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< TBackend, TGraphicsDevice >, LiteFX::Rendering::RenderBackend< DirectX12Backend, DirectX12Device >, and LiteFX::Rendering::RenderBackend< VulkanBackend, 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< TBackend, TGraphicsDevice >, LiteFX::Rendering::RenderBackend< DirectX12Backend, DirectX12Device >, and LiteFX::Rendering::RenderBackend< VulkanBackend, VulkanDevice >.