ISensorEngine

interface ISensorEngine

The sensor engine which automatically updates registered sensors.

Because hardware sensors may activate hardware components, or may require additional permissions on some operating systems, they are not activated by default. Instead, you need to M:Protogame.ISensorEngine.Register(Protogame.ISensor) sensors after you inject them into your class.

void Render(IGameContext gameContext, IRenderContext renderContext)

Internally called by T:Protogame.SensorEngineHook to update sensors during the render step.

Parameters:
  • gameContext (Protogame.IGameContext) – The current game context.
  • renderContext (Protogame.IRenderContext) – The current render context.
void Update(IGameContext gameContext, IUpdateContext updateContext)

Internally called by T:Protogame.SensorEngineHook to update sensors during the update step.

Parameters:
  • gameContext (Protogame.IGameContext) – The current game context.
  • updateContext (Protogame.IUpdateContext) – The current update context.
void Register(ISensor sensor)

Registers a hardware sensor with the sensor engine, ensuring that it is updated as the game runs.

Parameters:
  • sensor (Protogame.ISensor) – The hardware sensor to register.
void Deregister(ISensor sensor)

Deregisters a hardware sensor from the sensor engine, ensuring that it is no longer updated as the game runs.

Parameters:
  • sensor (Protogame.ISensor) – The hardware sensor to deregister.