CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::GraphicsCommandBuffer Class Referencefinal

An object that encapsulates rendering context for a view. More...

#include <CeresEngine/Graphics/GraphicsCommandBuffer.hpp>

Public Member Functions

template<typename Allocator >
 GraphicsCommandBuffer (std::allocator_arg_t, const Allocator &allocator)
 
 GraphicsCommandBuffer (AnyAllocatorReference allocator)
 
 GraphicsCommandBuffer () noexcept=default
 Creates a new GraphicsCommandBuffer instance.
 
template<typename T >
TpushCommand (const GraphicsState &graphicsState)
 Pushes a new command to the command list.
 
template<typename T >
TtryReuseCommand (const GraphicsState &graphicsState)
 Tries to get a command from the command list.
 

Public Attributes

Deque< GraphicsCommand, AnyAllocatorReferencecommands
 

Detailed Description

An object that encapsulates rendering context for a view.

Constructor & Destructor Documentation

◆ GraphicsCommandBuffer() [1/3]

template<typename Allocator >
CeresEngine::GraphicsCommandBuffer::GraphicsCommandBuffer ( std::allocator_arg_t  ,
const Allocator &  allocator 
)
inlineexplicit

◆ GraphicsCommandBuffer() [2/3]

CeresEngine::GraphicsCommandBuffer::GraphicsCommandBuffer ( AnyAllocatorReference  allocator)
inlineexplicit

◆ GraphicsCommandBuffer() [3/3]

CeresEngine::GraphicsCommandBuffer::GraphicsCommandBuffer ( )
explicitdefaultnoexcept

Creates a new GraphicsCommandBuffer instance.

Member Function Documentation

◆ pushCommand()

template<typename T >
T & CeresEngine::GraphicsCommandBuffer::pushCommand ( const GraphicsState graphicsState)
inline

Pushes a new command to the command list.

Template Parameters
TThe type of the command to be added.
Parameters
graphicsStateThe graphics state to create the command with.
Returns
A reference to the newly pushed command.

◆ tryReuseCommand()

template<typename T >
T & CeresEngine::GraphicsCommandBuffer::tryReuseCommand ( const GraphicsState graphicsState)
inline

Tries to get a command from the command list.

If the last command doesn't match the given type T or the given graphicsState a new command is pushed and returned.

Note
It's the callers responsibility to ensure that data from previous calls are not overridden in the command.
Template Parameters
TThe type of the command to be added or retrieved.
Parameters
graphicsStateThe graphics state to create the command with.
Returns
A reference to the existing command or a newly pushed one.

Member Data Documentation

◆ commands

Deque<GraphicsCommand, AnyAllocatorReference> CeresEngine::GraphicsCommandBuffer::commands

The documentation for this class was generated from the following file: