|
@@ -67,6 +67,7 @@ protected:
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// Macro for defining a main function which creates a Context and the application, then runs it
|
|
// Macro for defining a main function which creates a Context and the application, then runs it
|
|
|
|
|
+#ifndef IOS
|
|
|
#define DEFINE_APPLICATION_MAIN(className) \
|
|
#define DEFINE_APPLICATION_MAIN(className) \
|
|
|
int RunApplication() \
|
|
int RunApplication() \
|
|
|
{ \
|
|
{ \
|
|
@@ -75,5 +76,16 @@ int RunApplication() \
|
|
|
return application->Run(); \
|
|
return application->Run(); \
|
|
|
} \
|
|
} \
|
|
|
DEFINE_MAIN(RunApplication());
|
|
DEFINE_MAIN(RunApplication());
|
|
|
-
|
|
|
|
|
|
|
+#else
|
|
|
|
|
+// On iOS we will let this function exit, so do not hold the context and application in SharedPtr's
|
|
|
|
|
+#define DEFINE_APPLICATION_MAIN(className) \
|
|
|
|
|
+int RunApplication() \
|
|
|
|
|
+{ \
|
|
|
|
|
+ Urho3D::Context* context = new Urho3D::Context(); \
|
|
|
|
|
+ className* application = new className(context); \
|
|
|
|
|
+ return application->Run(); \
|
|
|
|
|
+} \
|
|
|
|
|
+DEFINE_MAIN(RunApplication());
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
}
|
|
}
|