plugin.cpp 450 B

123456789101112131415161718
  1. #include <cr.h>
  2. #include "types.h"
  3. CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
  4. switch (operation) {
  5. case CR_STEP:
  6. static_cast<dispatcher_proxy *>(ctx->userdata)->trigger(event{});
  7. static_cast<dispatcher_proxy *>(ctx->userdata)->trigger(message{42});
  8. break;
  9. case CR_CLOSE:
  10. case CR_LOAD:
  11. case CR_UNLOAD:
  12. // nothing to do here, this is only a test.
  13. break;
  14. }
  15. return 0;
  16. }