RenderPassFactory Class
A factory class for constructing `RenderPass` objects and populate their `RenderQueue`s based on a `helios::scene::Snapshot`. More...
Declaration
Public Member Functions Index
| RenderPass | buildRenderPass (const helios::scene::Snapshot &snapshot) const | 
| 
 Builds a `RenderPass` from a given `helios::scene::Snapshot`. More...  | |
| void | populateRenderQueue (const helios::scene::Snapshot &snapshot, helios::rendering::RenderQueue &renderQueue) const | 
| 
 Populates an existing `RenderQueue` with `RenderCommand`s based on a `Snapshot`. More...  | |
| std::unique_ptr< RenderCommand > | makeRenderCommand (const helios::scene::SnapshotItem &snapshotItem) const noexcept | 
| 
 Creates a single `RenderCommand` from a `helios::scene::SnapshotItem`. More...  | |
Protected Member Attributes Index
| const helios::util::log::Logger & | logger_ = ... | 
| 
 The logger used with this SRenderPassFactory. Defaults to HELIOS_LOG_SCOPE. More...  | |
Public Static Functions Index
| static RenderPassFactory & | getInstance () | 
| 
 Returns the singleton instance of `RenderPassFactory`. More...  | |
Description
A factory class for constructing `RenderPass` objects and populate their `RenderQueue`s based on a `helios::scene::Snapshot`.
This class implements a singleton pattern. The conversion of high-level scene data (Snapshot/SnapshotItems) into rather low level rendering commands might be realized with strategies and/or separate factories in the future.
Definition at line 31 of file RenderPassFactory.ixx.
Public Member Functions
buildRenderPass()
  | nodiscard | 
Builds a `RenderPass` from a given `helios::scene::Snapshot`.
This method orchestrates the creation of a `RenderQueue` and populates it with `RenderCommand`s derived from the `SnaphotItem`s within the snapshot. It also takes care of setting up frame-specific uniform values for the `RenderPass`.
- Parameters
 - 
snapshot A const ref to the snapshot containing the scene data for which the `RenderPass` is to be built.
 
- Returns
 A fully constructed `RenderPass` object. The `RenderPass` takes ownership of the `RenderQueue` and the frame specific `UniformValueMap`.
- See Also
 ::populateRenderQueue()
Definition at line 68 of file RenderPassFactory.ixx.
makeRenderCommand()
  | nodiscard noexcept | 
Creates a single `RenderCommand` from a `helios::scene::SnapshotItem`.
This method extracts necessary data from the `SnapshotItem` and bundles them into a `RenderCommand` object.
- Parameters
 - 
snapshotItem A const ref to the `SnapshotItem` from which to create the `RenderCommand`.
 
- Returns
 A unique pointer to the newly created `RenderCommand`. Returns nullptr if the associated rendabled is no longer available, or if the shader is not available from the `Renderable`'s material, or if the mesh is no longer available.
- Todo
 - 
future versions might want to use a FactoryMethod in RenderCommand that takes a SnapshotItem and creates a RenderCommand from it (e.g. RenderCommand::fromSnapshotItem()); or a Factory ReanderCommandBuilder() .withShader().withMesh().build();
 
Definition at line 103 of file RenderPassFactory.ixx.
populateRenderQueue()
  | 
Populates an existing `RenderQueue` with `RenderCommand`s based on a `Snapshot`.
This method clears the specified `RenderQueue` before adding new `RenderCommand`s to it.
- Parameters
 - 
snapshot A const ref to the `Snapshot` providing scene data.
renderQueue A ref to the `RenderQueue` to be filled. This queue will be cleared before before new commands are added.
 
- See Also
 ::makeRenderCommand()
Definition at line 81 of file RenderPassFactory.ixx.
Protected Member Attributes
logger_
  | protected | 
The logger used with this SRenderPassFactory. Defaults to HELIOS_LOG_SCOPE.
- Initialiser
 - 
= helios::util::log::LogManager::getInstance().registerLogger( HELIOS_LOG_SCOPE )
 
- Todo
 - 
constructor injection
 
Definition at line 40 of file RenderPassFactory.ixx.
Public Static Functions
getInstance()
  | static | 
Returns the singleton instance of `RenderPassFactory`.
- Returns
 A reference to the single `RenderPassFactory` instance.
Definition at line 50 of file RenderPassFactory.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.