#include #include #include "types.h" 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.); } }