ApplicationProxy.h 849 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "asserts_32.h"
  2. #include "asserts_64.h"
  3. class ApplicationProxy;
  4. typedef void(*callback_t)(ApplicationProxy *);
  5. typedef int(*sdl_callback)(Urho3D::Context *);
  6. class ApplicationProxy : public Urho3D::Application {
  7. public:
  8. ApplicationProxy (Urho3D::Context *ctx, callback_t csetup, callback_t cstart, callback_t cstop, const char* args, void * externalWindow) : Urho3D::Application (ctx)
  9. {
  10. setup = csetup;
  11. start = cstart;
  12. stop = cstop;
  13. engineParameters_ = Urho3D::Engine::ParseParameters(Urho3D::ParseArguments(args));
  14. if (externalWindow != NULL)
  15. engineParameters_["ExternalWindow"] = externalWindow;
  16. }
  17. void Setup ()
  18. {
  19. setup (this);
  20. }
  21. void Start ()
  22. {
  23. start (this);
  24. }
  25. void Stop ()
  26. {
  27. stop (this);
  28. }
  29. Urho3D::Engine *GetEngine ()
  30. {
  31. return engine_.Get ();
  32. }
  33. private:
  34. callback_t setup, start, stop;
  35. };