ecs_query_populate

Function ecs_query_populate 

Source
pub unsafe extern "C" fn ecs_query_populate(
    iter: *mut ecs_iter_t,
    when_changed: bool,
) -> i32
Expand description

Populate iterator fields. This operation can be combined with ecs_query_next_table to populate the iterator fields for the current table.

Populating fields conditionally can save time when a query uses change detection, and only needs iterator data when the table has changed. When this operation is called, inout/out terms will be marked dirty.

In cases where inout/out terms are conditionally written and no changes were made after calling ecs_query_populate, the ecs_query_skip function can be called to prevent the matched table components from being marked dirty.

This operation does should not be used with queries that match disabled components, union relationships, or with queries that use order_by.

When the when_changed argument is set to true, the iterator data will only populate when the data has changed, using query change detection.

@param iter The iterator. @param when_changed Only populate data when result has changed.