meta.cpp 687 B

1234567891011121314151617181920212223242526
  1. #include <component/input_listener_component.h>
  2. #include <component/position_component.h>
  3. #include <component/rect_component.h>
  4. #include <component/renderable_component.h>
  5. #include <entt/core/hashed_string.hpp>
  6. #include <entt/meta/factory.hpp>
  7. #include <meta/meta.h>
  8. namespace testbed {
  9. void meta_setup() {
  10. using namespace entt::literals;
  11. entt::meta_factory<input_listener_component>()
  12. .type("input listener")
  13. .data<&input_listener_component::command>("command");
  14. entt::meta_factory<position_component>()
  15. .type("position")
  16. .data<&SDL_FPoint::x>("x")
  17. .data<&SDL_FPoint::y>("y");
  18. // bind components...
  19. }
  20. } // namespace testbed