-
Notifications
You must be signed in to change notification settings - Fork 3
Events
tiffany352 edited this page Sep 3, 2012
·
6 revisions
Events are the backbone of IntenseLogic. Every "change" that may happen - be it through simulation, player input, or the network, will fire off an event to be handled by callbacks. See event.h for full details.
The original concept came from tiffany, inspired by idtech3, who needed a new structure for the engine through previous failed attempts. Events help to slow down the advance of a spaghettified architecture.
Events were updated to use libevent2 in September 2012.
Each event has 3 components:
- The range, which describes what module created it (common, graphics, network, etc.)
- The ID, which describes the individual type of the ID (tick, startup, update position, etc.)
- The data, which describes anything passed with the event (what key in a keydown event, the position and ID of an object when updating position, etc.)
Each event represents an instantaneous change in the state of the engine, and will be handled by proper functions based on its range and ID.
In addition, events are also used for creating timers that go off periodically.