meta.cpp 890 B

123456789101112131415161718192021222324252627282930
  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/davey/meta.hpp>
  7. #include <entt/meta/factory.hpp>
  8. #include <meta/meta.h>
  9. namespace testbed {
  10. void meta_setup() {
  11. using namespace entt::literals;
  12. entt::meta_factory<input_listener_component>()
  13. .custom<entt::davey_data>("input listener")
  14. .data<&input_listener_component::command>("command"_hs)
  15. .custom<entt::davey_data>("command");
  16. entt::meta_factory<position_component>()
  17. .custom<entt::davey_data>("position")
  18. .data<&SDL_FPoint::x>("x"_hs)
  19. .custom<entt::davey_data>("x")
  20. .data<&SDL_FPoint::y>("y"_hs)
  21. .custom<entt::davey_data>("y");
  22. // bind components...
  23. }
  24. } // namespace testbed