plugin.cpp 644 B

123456789101112131415161718192021222324
  1. #include <cr.h>
  2. #include <entt/core/type_info.hpp>
  3. #include <entt/signal/emitter.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<test_emitter *>(ctx->userdata)->publish<event>();
  11. static_cast<test_emitter *>(ctx->userdata)->publish<message>(42);
  12. static_cast<test_emitter *>(ctx->userdata)->publish<message>(3);
  13. break;
  14. case CR_CLOSE:
  15. case CR_LOAD:
  16. case CR_UNLOAD:
  17. // nothing to do here, this is only a test.
  18. break;
  19. }
  20. return 0;
  21. }