A render strategy, used by a render queue to prepare the render commands. More...
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 |
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.
nkGraphics::RenderStrategy::RenderStrategy | ( | ) |
Default constructor.
|
virtual |
Destructor.
|
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.
shader | A shader, provided by a MonoMaterialPass if it is the caller, nullptr otherwise. |
transparent | Whether the pass has been marked as transparent (true) or not (false). |
Implemented in nkGraphics::DefaultRenderStrategy.
|
pure virtual |
Called whenever a parent RenderQueue's Entity gets a new slot added to it.
ent | The entity calling. |
slot | The slot newly created. |
Implemented in nkGraphics::DefaultRenderStrategy.
|
pure virtual |
Called whenever a parent RenderQueue's Entity loses a slot.
ent | The entity calling. |
slot | The slot erased. |
Implemented in nkGraphics::DefaultRenderStrategy.