SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
spark::render::FrameBuffer< CommandBufferType > Class Template Referenceabstract

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

#include <FrameBuffer.h>

Inheritance diagram for spark::render::FrameBuffer< CommandBufferType >:
spark::render::IFrameBuffer

Public Types

using command_buffer_type = CommandBufferType
 
using image_type = typename command_buffer_type::image_type
 

Public Member Functions

virtual std::vector< std::shared_ptr< const command_buffer_type > > commandBuffers () const noexcept=0
 Gets all command buffers of the frame buffer.
 
virtual std::shared_ptr< const command_buffer_type > commandBuffer (unsigned index) const =0
 
virtual std::vector< const image_type * > images () const noexcept=0
 
virtual const image_type & image (unsigned location) const =0
 Gets the image storing the output attachment for the render target mapped at given location.
 
- Public Member Functions inherited from spark::render::IFrameBuffer
virtual unsigned int bufferIndex () const noexcept=0
 Gets the index of the frame buffer within the IRenderPass.
 
virtual spark::math::Vector2< unsigned > size () const noexcept=0
 Gets the current size of the frame buffer.
 
std::vector< std::shared_ptr< const ICommandBuffer > > commandBuffers () const noexcept
 Gets all command buffers of the frame buffer.
 
std::shared_ptr< const ICommandBuffercommandBuffer (unsigned int index) const
 Gets the command buffer that records draw commands for the frame buffer.
 
std::vector< const IImage * > images () const noexcept
 Gets all images storing the output attachments for the render targets of the IRenderPass.
 
const IImageimage (unsigned int location) const
 Gets the image storing the output attachment for the render target mapped at given location.
 
virtual void resize (const spark::math::Vector2< unsigned > &render_area)=0
 Invalidate and resize the frame buffer with given render_area.
 

Detailed Description

template<typename CommandBufferType>
class spark::render::FrameBuffer< CommandBufferType >

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

Template Parameters
CommandBufferTypeType of the command buffer (inherits from ICommandBuffer).

Member Function Documentation

◆ commandBuffer()

template<typename CommandBufferType >
virtual std::shared_ptr< const command_buffer_type > spark::render::FrameBuffer< CommandBufferType >::commandBuffer ( unsigned index) const
nodiscardpure virtual

◆ commandBuffers()

template<typename CommandBufferType >
virtual std::vector< std::shared_ptr< const command_buffer_type > > spark::render::FrameBuffer< CommandBufferType >::commandBuffers ( ) const
nodiscardpure virtualnoexcept

Gets all command buffers of the frame buffer.

Returns
A std::vector containing a std::shared_ptr to each command buffer of the frame buffer.

Implemented in spark::render::vk::VulkanFrameBuffer.

◆ image()

template<typename CommandBufferType >
virtual const image_type & spark::render::FrameBuffer< CommandBufferType >::image ( unsigned location) const
nodiscardpure virtual

Gets the image storing the output attachment for the render target mapped at given location.

Parameters
locationThe location of the render target to get the image for.
Returns
A std::shared_ptr to the image storing the output attachment for the render target mapped at given location.

Implemented in spark::render::vk::VulkanFrameBuffer.

◆ images()

template<typename CommandBufferType >
virtual std::vector< const image_type * > spark::render::FrameBuffer< CommandBufferType >::images ( ) const
nodiscardpure virtualnoexcept