Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
Collaboration diagram for Singletons:

Macros

#define ecs_singleton_add(world, comp)    ecs_add(world, ecs_id(comp), comp)
 Add a singleton component.
 
#define ecs_singleton_remove(world, comp)    ecs_remove(world, ecs_id(comp), comp)
 Remove a singleton component.
 
#define ecs_singleton_get(world, comp)    ecs_get(world, ecs_id(comp), comp)
 Get a singleton component.
 
#define ecs_singleton_get_mut(world, comp)    ecs_get_mut(world, ecs_id(comp), comp)
 Get a mutable pointer to a singleton component.
 
#define ecs_singleton_set_ptr(world, comp, ptr)    ecs_set_ptr(world, ecs_id(comp), comp, ptr)
 Set a singleton component using a pointer.
 
#define ecs_singleton_set(world, comp, ...)    ecs_set(world, ecs_id(comp), comp, __VA_ARGS__)
 Set a singleton component value.
 
#define ecs_singleton_ensure(world, comp)    ecs_ensure(world, ecs_id(comp), comp)
 Ensure a singleton component, return mutable pointer.
 
#define ecs_singleton_emplace(world, comp, is_new)    ecs_emplace(world, ecs_id(comp), comp, is_new)
 Emplace a singleton component.
 
#define ecs_singleton_modified(world, comp)    ecs_modified(world, ecs_id(comp), comp)
 Signal that a singleton component has been modified.
 

Detailed Description

Macro Definition Documentation

◆ ecs_singleton_add

#define ecs_singleton_add ( world,
comp )    ecs_add(world, ecs_id(comp), comp)

Add a singleton component.

Definition at line 487 of file flecs_c.h.

◆ ecs_singleton_emplace

#define ecs_singleton_emplace ( world,
comp,
is_new )    ecs_emplace(world, ecs_id(comp), comp, is_new)

Emplace a singleton component.

Definition at line 515 of file flecs_c.h.

◆ ecs_singleton_ensure

#define ecs_singleton_ensure ( world,
comp )    ecs_ensure(world, ecs_id(comp), comp)

Ensure a singleton component, return mutable pointer.

Definition at line 511 of file flecs_c.h.

◆ ecs_singleton_get

#define ecs_singleton_get ( world,
comp )    ecs_get(world, ecs_id(comp), comp)

Get a singleton component.

Definition at line 495 of file flecs_c.h.

◆ ecs_singleton_get_mut

#define ecs_singleton_get_mut ( world,
comp )    ecs_get_mut(world, ecs_id(comp), comp)

Get a mutable pointer to a singleton component.

Definition at line 499 of file flecs_c.h.

◆ ecs_singleton_modified

#define ecs_singleton_modified ( world,
comp )    ecs_modified(world, ecs_id(comp), comp)

Signal that a singleton component has been modified.

Definition at line 519 of file flecs_c.h.

◆ ecs_singleton_remove

#define ecs_singleton_remove ( world,
comp )    ecs_remove(world, ecs_id(comp), comp)

Remove a singleton component.

Definition at line 491 of file flecs_c.h.

◆ ecs_singleton_set

#define ecs_singleton_set ( world,
comp,
... )    ecs_set(world, ecs_id(comp), comp, __VA_ARGS__)

Set a singleton component value.

Definition at line 507 of file flecs_c.h.

◆ ecs_singleton_set_ptr

#define ecs_singleton_set_ptr ( world,
comp,
ptr )    ecs_set_ptr(world, ecs_id(comp), comp, ptr)

Set a singleton component using a pointer.

Definition at line 503 of file flecs_c.h.