ecs_filter_init

Function ecs_filter_init 

Source
pub unsafe extern "C" fn ecs_filter_init(
    world: *mut ecs_world_t,
    desc: *const ecs_filter_desc_t,
) -> *mut ecs_filter_t
Expand description

Initialize filter A filter is a lightweight object that can be used to query for entities in a world. Filters, as opposed to queries, do not cache results. They are therefore slower to iterate, but are faster to create.

When a filter is copied by value, make sure to use “ecs_filter_move” to ensure that the terms pointer still points to the inline array:

ecs_filter_move(&dst_filter, &src_filter)

Alternatively, the ecs_filter_move function can be called with both arguments set to the same filter, to ensure the pointer is valid:

ecs_filter_move(&f, &f)

It is possible to create a filter without allocating any memory, by setting the .storage member in ecs_filter_desc_t. See the documentation for the member for more details.

@param world The world. @param desc Properties for the filter to create. @return The filter if successful, NULL if not successful.