API Documentation
Public Member Functions | List of all members
nkGraphics::RenderCommandQueue Class Referencefinal

A queue of rendering commands. More...

Public Member Functions

 RenderCommandQueue () noexcept
 
 RenderCommandQueue (nkMemory::BufferCast< RenderCommand > commands) noexcept
 
 RenderCommandQueue (nkMemory::BufferView< RenderCommand > commandsView) noexcept
 
nkMemory::BufferView< RenderCommandgetCommands () const
 
void addCommand (const RenderCommand &command)
 
void reset ()
 

Detailed Description

A queue of rendering commands.

Constructor & Destructor Documentation

◆ RenderCommandQueue() [1/3]

nkGraphics::RenderCommandQueue::RenderCommandQueue ( )
noexcept

Default constructor.

◆ RenderCommandQueue() [2/3]

nkGraphics::RenderCommandQueue::RenderCommandQueue ( nkMemory::BufferCast< RenderCommand commands)
noexcept

Command buffer move constructor. The BufferCast provided will be moved over and used within the queue.

Parameters
commandsThe commands to move over.

◆ RenderCommandQueue() [3/3]

nkGraphics::RenderCommandQueue::RenderCommandQueue ( nkMemory::BufferView< RenderCommand commandsView)
noexcept

Command buffer view constructor. The BufferView provided will be referenced as-is, without any new memory allocation.

Parameters
commandsViewThe command buffer to reference.
Remarks
As no new allocation takes place, the buffer the view refers to has to remain alive through the pass rendering.

Member Function Documentation

◆ getCommands()

nkMemory::BufferView<RenderCommand> nkGraphics::RenderCommandQueue::getCommands ( ) const
Returns
A view over the buffer of command internally held.

◆ addCommand()

void nkGraphics::RenderCommandQueue::addCommand ( const RenderCommand command)

Allows to add a new command to the buffer.

Parameters
commandThe command to add.

◆ reset()

void nkGraphics::RenderCommandQueue::reset ( )

Resets the queue to make it ready to start over.

Remarks
This method allows to keep the internal memory, effectively making it reusable.

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