Skip to content

Commit

Permalink
#124 extend ecs_emit doc with instructions for sending event for entity
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Dec 1, 2021
1 parent 2886f25 commit a255635
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/flecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -3032,6 +3032,18 @@ typedef struct ecs_event_desc_t {
* Triggers are invoked synchronously. It is therefore safe to use stack-based
* data as event context, which can be set in the "param" member.
*
* To send a notification for a single entity, an application should set the
* following members in the event descriptor:
*
* - table: set to the table of the entity
* - offset: set to the row of the entity in the table
* - count: set to 1
*
* The table & row of the entity can be obtained like this:
* ecs_record_t *r = ecs_record_find(world, e);
* desc.table = r->table;
* desc.offset = ECS_RECORD_TO_ROW(r->row);
*
* @param world The world.
* @param desc Event parameters.
*/
Expand Down

0 comments on commit a255635

Please sign in to comment.