plugin.cpp 582 B

1234567891011121314151617181920212223
  1. #include <cr.h>
  2. #include <entt/core/type_info.hpp>
  3. #include <entt/signal/dispatcher.hpp>
  4. #include "types.h"
  5. template<typename Type>
  6. struct entt::type_index<Type> {};
  7. CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
  8. switch (operation) {
  9. case CR_STEP:
  10. static_cast<entt::dispatcher *>(ctx->userdata)->trigger<event>();
  11. static_cast<entt::dispatcher *>(ctx->userdata)->trigger<message>(42);
  12. break;
  13. case CR_CLOSE:
  14. case CR_LOAD:
  15. case CR_UNLOAD:
  16. // nothing to do here, this is only a test.
  17. break;
  18. }
  19. return 0;
  20. }