LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::Rendering::FrameBuffer< TCommandBuffer > Class Template Referenceabstract

Stores the images for the output attachments for a back buffer of a RenderPass, as well as a CommandBuffer instance, that records draw commands. More...

#include <rendering.hpp>

Inherits LiteFX::Rendering::IFrameBuffer.

Public Types

using command_buffer_type = TCommandBuffer
 
using image_type = command_buffer_type::image_type
 

Public Member Functions

virtual ~FrameBuffer () noexcept=default
 
virtual Array< const command_buffer_type * > commandBuffers () const noexcept=0
 
virtual const command_buffer_typecommandBuffer (const UInt32 &index) const =0
 Returns a command buffer that records draw commands for the frame buffer. More...
 
virtual Array< const image_type * > images () const noexcept=0
 
virtual const image_typeimage (const UInt32 &location) const =0
 Returns the image that stores the output attachment for the render target mapped the location passed with location . More...
 
- Public Member Functions inherited from LiteFX::Rendering::IFrameBuffer
virtual ~IFrameBuffer () noexcept=default
 
virtual const UInt32bufferIndex () const noexcept=0
 Returns the index of the buffer within the RenderPass. More...
 
virtual const Size2dsize () const noexcept=0
 Returns the current size of the frame buffer. More...
 
virtual size_t getWidth () const noexcept=0
 Returns the current width of the frame buffer. More...
 
virtual size_t getHeight () const noexcept=0
 Returns the current height of the frame buffer. More...
 
Array< const ICommandBuffer * > commandBuffers () const noexcept
 Returns all command buffers, the frame buffer stores. More...
 
virtual const ICommandBuffercommandBuffer (const UInt32 &index) const =0
 Returns a command buffer that records draw commands for the frame buffer. More...
 
Array< const IImage * > images () const noexcept
 Returns the images that store the output attachments for the render targets of the RenderPass. More...
 
virtual const IImageimage (const UInt32 &location) const =0
 Returns the image that stores the output attachment for the render target mapped the location passed with location . More...
 
virtual void resize (const Size2d &renderArea)=0
 Causes the frame buffer to be invalidated and recreated with a new size. More...
 

Detailed Description

template<typename TCommandBuffer>
requires rtti::implements<TCommandBuffer, CommandBuffer<typename TCommandBuffer::buffer_type, typename TCommandBuffer::vertex_buffer_type, typename TCommandBuffer::index_buffer_type, typename TCommandBuffer::image_type, typename TCommandBuffer::barrier_type, typename TCommandBuffer::pipeline_type>>
class LiteFX::Rendering::FrameBuffer< TCommandBuffer >

Stores the images for the output attachments for a back buffer of a RenderPass, as well as a CommandBuffer instance, that records draw commands.

Template Parameters
TCommandBufferThe type of the command buffer. Must implement CommandBuffer.
See also
RenderTarget

Member Typedef Documentation

◆ command_buffer_type

template<typename TCommandBuffer >
using LiteFX::Rendering::FrameBuffer< TCommandBuffer >::command_buffer_type = TCommandBuffer

◆ image_type

template<typename TCommandBuffer >
using LiteFX::Rendering::FrameBuffer< TCommandBuffer >::image_type = command_buffer_type::image_type

Constructor & Destructor Documentation

◆ ~FrameBuffer()

template<typename TCommandBuffer >
virtual LiteFX::Rendering::FrameBuffer< TCommandBuffer >::~FrameBuffer ( )
virtualdefaultnoexcept

Member Function Documentation

◆ commandBuffer()

template<typename TCommandBuffer >
virtual const command_buffer_type & LiteFX::Rendering::FrameBuffer< TCommandBuffer >::commandBuffer ( const UInt32 index) const
pure virtual

Returns a command buffer that records draw commands for the frame buffer.

Implements LiteFX::Rendering::IFrameBuffer.

Implemented in LiteFX::Rendering::Backends::DirectX12FrameBuffer, and LiteFX::Rendering::Backends::VulkanFrameBuffer.

◆ commandBuffers()

template<typename TCommandBuffer >
virtual Array< const command_buffer_type * > LiteFX::Rendering::FrameBuffer< TCommandBuffer >::commandBuffers ( ) const
pure virtualnoexcept

◆ image()

template<typename TCommandBuffer >
virtual const image_type & LiteFX::Rendering::FrameBuffer< TCommandBuffer >::image ( const UInt32 location) const
pure virtual

Returns the image that stores the output attachment for the render target mapped the location passed with location .

Implements LiteFX::Rendering::IFrameBuffer.

Implemented in LiteFX::Rendering::Backends::DirectX12FrameBuffer, and LiteFX::Rendering::Backends::VulkanFrameBuffer.

◆ images()

template<typename TCommandBuffer >
virtual Array< const image_type * > LiteFX::Rendering::FrameBuffer< TCommandBuffer >::images ( ) const
pure virtualnoexcept