API Documentation
Public Member Functions | List of all members
nkGraphics::RenderStrategy Class Referenceabstract

A render strategy, used by a render queue to prepare the render commands. More...

Inheritance diagram for nkGraphics::RenderStrategy:
nkGraphics::DefaultRenderStrategy

Public Member Functions

 RenderStrategy ()
 
virtual ~RenderStrategy ()
 
virtual RenderCommandQueue bakeRenderCommandQueue (Shader *shader, bool transparent)=0
 
virtual void updateAddRenderSlot (Entity *ent, const EntityRenderInfoSlot *slot)=0
 
virtual void updateEraseRenderSlot (Entity *ent, const EntityRenderInfoSlot *slot)=0
 

Detailed Description

A render strategy, used by a render queue to prepare the render commands.

A strategy allows to completely overwrite how a render queue should be rendered eventually. This will be called during a MonoMaterialPass, or a RenderScenePass, from the rendered RenderQueue. The strategy will have to provide back a RenderCommandQueue driving, sequentially, all the state changing commands and drawing requests.
A Strategy is free to generate this queue however it sees fit. See the DefaultRenderStrategy to get an idea of how Nilkins does it by default.

Constructor & Destructor Documentation

◆ RenderStrategy()

nkGraphics::RenderStrategy::RenderStrategy ( )

Default constructor.

◆ ~RenderStrategy()

virtual nkGraphics::RenderStrategy::~RenderStrategy ( )
virtual

Destructor.

Member Function Documentation

◆ bakeRenderCommandQueue()

virtual RenderCommandQueue nkGraphics::RenderStrategy::bakeRenderCommandQueue ( Shader shader,
bool  transparent 
)
pure virtual

Generates the final command queue that will be communicated to the active Renderer. This method is called whenever a RenderQueue is rendered, and should return the queue to be executed from it.

Parameters
shaderA shader, provided by a MonoMaterialPass if it is the caller, nullptr otherwise.
transparentWhether the pass has been marked as transparent (true) or not (false).
Returns
The final baked command queue, created from all the information and states provided.

Implemented in nkGraphics::DefaultRenderStrategy.

◆ updateAddRenderSlot()

virtual void nkGraphics::RenderStrategy::updateAddRenderSlot ( Entity ent,
const EntityRenderInfoSlot slot 
)
pure virtual

Called whenever a parent RenderQueue's Entity gets a new slot added to it.

Parameters
entThe entity calling.
slotThe slot newly created.
Remarks
This method can be used to follow in parallel what a RenderQueue is doing, and track data in a more fitting format.

Implemented in nkGraphics::DefaultRenderStrategy.

◆ updateEraseRenderSlot()

virtual void nkGraphics::RenderStrategy::updateEraseRenderSlot ( Entity ent,
const EntityRenderInfoSlot slot 
)
pure virtual

Called whenever a parent RenderQueue's Entity loses a slot.

Parameters
entThe entity calling.
slotThe slot erased.
Remarks
This method can be used to follow in parallel what a RenderQueue is doing, and keep data in a more fitting format.

Implemented in nkGraphics::DefaultRenderStrategy.


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