VoxelEngine
 
Loading...
Searching...
No Matches
engine::Engine Class Referenceabstract

Public Member Functions

 Engine (std::unique_ptr< Window > window)
 
void submitRender (RenderContext &&ctx, bool immediate=false)
 
void submitRender (GroupRenderContext &&ctx, bool immediate=false)
 
virtual void flush ()
 Flushes the render queue; loops over all render passes and renders all contexts.
 
void subscribeUpdate (std::shared_ptr< Updateable > updateable)
 
void subscribeTick (std::shared_ptr< Tickable > tickable)
 
void fireUpdate (float dt)
 
void gameloop ()
 
virtual void beforeRender ()
 
virtual void render (double dt)=0
 
virtual void afterRender ()
 
Windowwindow () const
 
InputSysteminputSystem () const
 
void setDirectionalLightSource (std::shared_ptr< Sun > lightSource, uint8_t passPosition=0)
 
std::shared_ptr< SundirectionalLightSource () const
 

Static Public Attributes

static float TickRate = 1.0f / 30.0f
 

Protected Member Functions

void beginFrame ()
 
void endFrame ()
 

Protected Attributes

std::unique_ptr< InputSystemm_inputSystem
 
std::shared_ptr< Sunm_directionalLightSource
 
RenderPassRegistrym_passRegistry
 
std::vector< std::variant< RenderContext, GroupRenderContext > > m_renderQueue
 
std::unique_ptr< Windowm_window
 

Member Function Documentation

◆ flush()

void Engine::flush ( )
virtual

Flushes the render queue; loops over all render passes and renders all contexts.

Note
This is called between beforeRender() and afterRender().
Can be overridden, consumer must clear the m_renderQueue.

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