New staging API, stricter API checks, deprecated warnings. #340
SanderMertens
started this conversation in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A new API has just merged that lets applications use the threading features of Flecs with application managed threads. Here are a few examples of the new API:
https://github.com/SanderMertens/flecs/tree/master/examples/c/55_custom_threads
https://github.com/SanderMertens/flecs/tree/master/examples/c/56_custom_merge
https://github.com/SanderMertens/flecs/tree/master/examples/cpp/55_custom_threads
https://github.com/SanderMertens/flecs/tree/master/examples/cpp/56_custom_merge
When updating Flecs, there are a few things to keep in mind:
You may now get deprecated warnings if you use deprecated functions in your code. You can silence those warnings by defining
FLECS_NO_DEPRECATED_WARNINGS
. That should still let you build without warnings & fix the deprecated calls when it's convenientThe staging implementation is now a lot simpler & more robust with stricter checks on what is allowed/not allowed. This could mean that things that used to work "by accident" now throw an assert that looks like
world->magic == ECS_WORLD_MAGIC
The world passed to systems will now actually be a pointer to a stage, and no longer point to the world object itself. This provides a private context for systems to write modifications to, and allows applications to use multiple stages at the same time. This was already the case for multithreaded applications, but now also happens for applications that do not use threads.
The core now has much stricter checking on the validity of entities passed to functions. Where previously some functions would still work on entities that are no longer alive (such as
ecs_get_type
) those functions will now throw asserts if the entity is no longer alive.The
ecs_get_thread_index
function is now deprecated (useecs_get_stage_id
)On the whole these new changes should detect issues much earlier than before.
Beta Was this translation helpful? Give feedback.
All reactions