meta.cpp 862 B

12345678910111213141516171819202122232425262728293031
  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/meta/factory.hpp>
  6. #include <meta/meta.h>
  7. namespace testbed {
  8. void meta_setup() {
  9. entt::meta_factory<input_listener_component>()
  10. .type("input listener")
  11. .data<&input_listener_component::command>("command");
  12. entt::meta_factory<position_component>()
  13. .type("position")
  14. .data<&SDL_FPoint::x>("x")
  15. .data<&SDL_FPoint::y>("y");
  16. entt::meta_factory<rect_component>()
  17. .type("rect")
  18. .data<&SDL_FRect::x>("x")
  19. .data<&SDL_FRect::y>("y")
  20. .data<&SDL_FRect::w>("w")
  21. .data<&SDL_FRect::h>("h");
  22. entt::meta_factory<renderable_component>()
  23. .type("renderable");
  24. }
  25. } // namespace testbed