ApplicationProxy.h 822 B

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