plugin.cpp 561 B

1234567891011121314151617181920
  1. #include <cr.h>
  2. #include <entt/signal/dispatcher.hpp>
  3. #include "../../../common/boxed_type.h"
  4. #include "../../../common/value_type.h"
  5. CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
  6. switch(operation) {
  7. case CR_STEP:
  8. static_cast<entt::dispatcher *>(ctx->userdata)->trigger<test::empty>();
  9. static_cast<entt::dispatcher *>(ctx->userdata)->trigger(test::boxed_int{4});
  10. break;
  11. case CR_CLOSE:
  12. case CR_LOAD:
  13. case CR_UNLOAD:
  14. // nothing to do here, this is only a test.
  15. break;
  16. }
  17. return 0;
  18. }