This wiki is archived and useful information is being migrated to the main bzflag.org website
Editing Events (API)
Warning: The database has been locked for maintenance, so you will not be able to save your edits right now. You may wish to copy and paste your text into a text file and save it for later.
The administrator who locked it offered this explanation: Archived wiki
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 4: | Line 4: | ||
==Installation and Removal== | ==Installation and Removal== | ||
− | The callbacks for events are typically installed during the [[bz_Load]] | + | The callbacks for events are typically installed during the [[bz_Load]] entry point in a plug-in, so they can be active when a plug-in is first loaded. |
The plug-in must call the function; | The plug-in must call the function; | ||
− | |||
BZF_API bool [[bz_registerEvent]] ( bz_eEventType eventType, [[bz_EventHandler]]* eventHandler ); | BZF_API bool [[bz_registerEvent]] ( bz_eEventType eventType, [[bz_EventHandler]]* eventHandler ); | ||
− | + | The plug-in registers and event callback derived from [[bz_EventHandler]] for each specific event types it wishes to monitor. | |
− | + | ||
− | + | When a plug-in no longer needs to monitor an event, or when it is unloaded in the [[bz_Unload]] entry point, the plug-in must remove the installed callback by calling the function; | |
− | |||
− | |||
− | |||
BZF_API bool [[bz_removeEvent]] ( bz_eEventType eventType, [[bz_EventHandler]]* eventHandler ); | BZF_API bool [[bz_removeEvent]] ( bz_eEventType eventType, [[bz_EventHandler]]* eventHandler ); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
==Event Handler== | ==Event Handler== |