Ovis_Entity_Destroy_Proc_Set()
Abstract
Attaches a destroy procedure to an Ovis entity.
Syntax
Ovis_Entity_Destroy_Proc_Set (ent_ptr, destroy_proc)
| Argument | Type | Description |
|---|---|---|
ent_ptr |
OvisT_Entity * |
Entity on which to attach the destroy procedure. |
destroy_proc |
OvisT_Entity_State_Destroy_Proc | Destroy procedure to attach. |
Return Type
OvisT_Entity_State_Destroy_Proc
Previous destroy_proc, or PRGC_NIL if none.
Header
ovis_entity.h
Details
This function attaches a user-defined destroy_proc to an Ovis entity. The prototype for destroy_proc is given in OvisT_Entity_State_Destroy_Proc.
Example
static void new_destroy_proc (OvisT_Entity * entity_ptr, void * user_state_ptr)
{
…
}
OvisT_Entity * ent;
OvisT_Entity_State_Destroy_Proc old_proc;
/* … entity created at some point */
old_proc = Ovis_Entity_Destroy_Proc_Set (entity, new_destroy_proc);
Errors
- Entity is NIL.
Reference
- Use the function Ovis_Entity_State_Set() to specify the entity state.
- Use the function Ovis_Entity_Destroy() to destroy an entity.