Class DEvent



DEvent is an abstract class that lets you create custom events. It registers itself with a DEngine, and has a virtual update function that is called whenever the DEngine's update is called.

Public Functions

Protected Functions


DEvent(DEngine *engine)

The default constructor, creates a DEvent that is registered with the given engine.


DEvent(const DEvent &source)

Copy constructor, creates an event that's registered to the same DEngine as source.


DEvent& operator= (const DEvent &source)

Assigns this DEvent to use the same DEngine as source.


virtual unsigned int update(void) = 0

An event handler, this function is called whenever the DEngine's update function is called. It should return the number of events that were dispatched, which will vary depending on the event type. For example, a DTimer will return 0, or 1 if the timer expired.


void joinEngine(DEngine *engine)

Causes the DEvent to de-register itself from the current DEngine, and re-register itself with engine.











Back to class reference