#include #include #include "../common/types.h" template class entt::basic_registry; ENTT_API void update_position(entt::registry ®istry) { registry.view().each([](auto &pos, auto &vel) { pos.x += static_cast(16 * vel.dx); pos.y += static_cast(16 * vel.dy); }); } ENTT_API void emplace_velocity(entt::registry ®istry) { // forces the creation of the pool for the velocity component static_cast(registry.storage()); for(auto entity: registry.view()) { registry.emplace(entity, 1., 1.); } }