Nebula
Loading...
Searching...
No Matches
Game::FrameEvent Class Reference

#include <frameevent.h>

Classes

struct  Callback
 A callback which runs once per event run. More...
class  Batch
 A batch of frame callbacks. More...

Public Member Functions

 FrameEvent ()=default
 ~FrameEvent ()
void Run (World *world)
 Runs the frame event.
void AddProcessor (Processor *processor)
 Adds a processor to the frame event.
void AddCallback (int order, ProcessorPhase phase, std::function< void(World *)> func)
 Adds a callback to the frame event, sorted by order among the batches.
void RemoveProcessor (Processor *processor)
 Removes a processor for the frame event. Does not free the memory, you need to handle this yourself.
void Prefilter (World *world, bool force=false)
 prefilter all processors. Should not be done per frame - instead use CacheTable if you need to do incremental caching
void CacheTable (MemDb::TableId, MemDb::TableSignature const &)
 add a table to the caches of any processors that accepts it, that is attached to this frame event
Util::Array< Batch const * > const GetBatches () const

Public Attributes

Util::StringAtom name
int order = 100
Timing::Time fixedStep = 0.0
 0 when the event runs once per app frame, otherwise the fixed step it runs on
uint32_t timeSourceHash = 0
 time source the fixed steps come from, 0 when the event is not fixed

Private Attributes

friend FramePipeline
FramePipeline * pipeline
 Which pipeline is this event attached to.
Util::Array< Batch * > batches
 Batches that this event will execute.
Util::Array< Callback > callbacks
 Callbacks that this event will execute, sorted by order.

Constructor & Destructor Documentation

◆ FrameEvent()

Game::FrameEvent::FrameEvent ( )
default

◆ ~FrameEvent()

Game::FrameEvent::~FrameEvent ( )

Member Function Documentation

◆ AddCallback()

void Game::FrameEvent::AddCallback ( int order,
ProcessorPhase phase,
std::function< void(World *)> func )

Adds a callback to the frame event, sorted by order among the batches.

The phase is which world mode the callback is allowed to run in, which is what keeps a callback out of a world that is not simulating

◆ AddProcessor()

void Game::FrameEvent::AddProcessor ( Processor * processor)

Adds a processor to the frame event.

◆ CacheTable()

void Game::FrameEvent::CacheTable ( MemDb::TableId tid,
MemDb::TableSignature const & signature )

add a table to the caches of any processors that accepts it, that is attached to this frame event

◆ GetBatches()

Util::Array< FrameEvent::Batch const * > const Game::FrameEvent::GetBatches ( ) const

◆ Prefilter()

void Game::FrameEvent::Prefilter ( World * world,
bool force = false )

prefilter all processors. Should not be done per frame - instead use CacheTable if you need to do incremental caching

◆ RemoveProcessor()

void Game::FrameEvent::RemoveProcessor ( Processor * processor)

Removes a processor for the frame event. Does not free the memory, you need to handle this yourself.

◆ Run()

void Game::FrameEvent::Run ( World * world)

Runs the frame event.

Member Data Documentation

◆ batches

Util::Array<Batch*> Game::FrameEvent::batches
private

Batches that this event will execute.

◆ callbacks

Util::Array<Callback> Game::FrameEvent::callbacks
private

Callbacks that this event will execute, sorted by order.

◆ fixedStep

Timing::Time Game::FrameEvent::fixedStep = 0.0

0 when the event runs once per app frame, otherwise the fixed step it runs on

◆ FramePipeline

friend Game::FrameEvent::FramePipeline
private

◆ name

Util::StringAtom Game::FrameEvent::name

◆ order

int Game::FrameEvent::order = 100

◆ pipeline

FramePipeline* Game::FrameEvent::pipeline
private

Which pipeline is this event attached to.

◆ timeSourceHash

uint32_t Game::FrameEvent::timeSourceHash = 0

time source the fixed steps come from, 0 when the event is not fixed


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