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. The DEvent automatically unregisters itself on deletion.


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 it dispatched, which will vary depending on the event type. For example, a DTimer will normally return 0, or 1 if the timer expired.


void joinEngine(DEngine *engine)

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





















Back to class reference