LiteFX 0.3.1.2022
Computer Graphics Engine
LiteFX::Rendering::IFrameBuffer Class Referenceabstract

The interface for a frame buffer. More...

#include <rendering_api.hpp>

Inherited by LiteFX::Rendering::FrameBuffer< DirectX12CommandBuffer >, LiteFX::Rendering::FrameBuffer< VulkanCommandBuffer >, and LiteFX::Rendering::FrameBuffer< TCommandBuffer >.

Public Member Functions

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

The interface for a frame buffer.

Constructor & Destructor Documentation

◆ ~IFrameBuffer()

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

Member Function Documentation

◆ bufferIndex()

virtual const UInt32 & LiteFX::Rendering::IFrameBuffer::bufferIndex ( ) const
pure virtualnoexcept

Returns the index of the buffer within the RenderPass.

A render pass stores multiple frame buffers, each with their own index. Calling RenderPass::frameBuffer with this index on the frame buffers render pass returns the current frame buffer instance (i.e. the same instance, as the one, the index has been requested from).

Returns
the index of the buffer within the RenderPass.

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

◆ commandBuffer()

virtual const ICommandBuffer & LiteFX::Rendering::IFrameBuffer::commandBuffer ( const UInt32 index) const
pure virtual

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

Parameters
indexThe index of the command buffer.
Returns
A command buffer that records draw commands for the frame buffer
Exceptions
ArgumentOutOfRangeExceptionThrown, if the frame buffer does not store a command buffer at index .
See also
commandBuffers

Implemented in LiteFX::Rendering::FrameBuffer< TCommandBuffer >, LiteFX::Rendering::Backends::DirectX12FrameBuffer, LiteFX::Rendering::Backends::VulkanFrameBuffer, LiteFX::Rendering::FrameBuffer< DirectX12CommandBuffer >, and LiteFX::Rendering::FrameBuffer< VulkanCommandBuffer >.

◆ commandBuffers()

Array< const ICommandBuffer * > LiteFX::Rendering::IFrameBuffer::commandBuffers ( ) const
inlinenoexcept

Returns all command buffers, the frame buffer stores.

Returns
All command buffers, the frame buffer stores.
See also
commandBuffer

◆ getHeight()

virtual size_t LiteFX::Rendering::IFrameBuffer::getHeight ( ) const
pure virtualnoexcept

Returns the current height of the frame buffer.

Returns
The current height of the frame buffer.</returns
See also
width, size, resize

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

◆ getWidth()

virtual size_t LiteFX::Rendering::IFrameBuffer::getWidth ( ) const
pure virtualnoexcept

Returns the current width of the frame buffer.

Returns
The current width of the frame buffer.
See also
height, size, resize

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

◆ image()

virtual const IImage & LiteFX::Rendering::IFrameBuffer::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 .

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

Implemented in LiteFX::Rendering::FrameBuffer< TCommandBuffer >, LiteFX::Rendering::Backends::DirectX12FrameBuffer, LiteFX::Rendering::Backends::VulkanFrameBuffer, LiteFX::Rendering::FrameBuffer< DirectX12CommandBuffer >, and LiteFX::Rendering::FrameBuffer< VulkanCommandBuffer >.

◆ images()

Array< const IImage * > LiteFX::Rendering::IFrameBuffer::images ( ) const
inlinenoexcept

Returns the images that store the output attachments for the render targets of the RenderPass.

Returns
The images that store the output attachments for the render targets of the RenderPass.

◆ resize()

virtual void LiteFX::Rendering::IFrameBuffer::resize ( const Size2d renderArea)
pure virtual

Causes the frame buffer to be invalidated and recreated with a new size.

A frame buffer resize causes all render target resources (i.e. images) to be re-created. This is done by the implementation itself, except for present targets, which require a view of an image created on a ISwapChain. If the frame buffer has a present target, it calls ISwapChain::images on the parent devices' swap chain. Note that there should only be one render pass, that contains present targets, otherwise the images are written by different render passes, which may result in undefined behavior.

Parameters
renderAreaThe new dimensions of the frame buffer.

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

◆ size()

virtual const Size2d & LiteFX::Rendering::IFrameBuffer::size ( ) const
pure virtualnoexcept

Returns the current size of the frame buffer.

Returns
The current size of the frame buffer.
See also
height, width, resize

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