dmuratshin 9 years ago
parent
commit
99ca8697de
2 changed files with 12 additions and 15 deletions
  1. 8 15
      examples/HelloWorld/src/main.cpp
  2. 4 0
      oxygine/src/oxygine_include.h

+ 8 - 15
examples/HelloWorld/src/main.cpp

@@ -138,9 +138,12 @@ int main(int argc, char* argv[])
 
 #include "SDL_main.h"
 #include "SDL.h"
+
 extern "C"
 {
     void one(void* param) { mainloop(); }
+    void oneEmsc() { mainloop(); }
+
     int main(int argc, char* argv[])
     {
 
@@ -151,21 +154,11 @@ extern "C"
         SDL_iPhoneSetAnimationCallback(core::getWindow(), 1, one, nullptr);
 #endif
 
+#if EMSCRIPTEN
+        emscripten_set_main_loop(oneEmsc, 0, 0);
+#endif
+
         return 0;
     }
 };
-#endif
-
-
-#ifdef EMSCRIPTEN
-#include <emscripten.h>
-
-void one() { mainloop(); }
-
-int main(int argc, char* argv[])
-{
-    run();
-    emscripten_set_main_loop(one, 0, 0);
-    return 0;
-}
-#endif
+#endif

+ 4 - 0
oxygine/src/oxygine_include.h

@@ -11,6 +11,10 @@
 #include <TargetConditionals.h>
 #endif
 
+#if EMSCRIPTEN
+#include <emscripten.h>
+#endif
+
 
 //Round everything to whole pixels during rendering.
 // Helps to avoid artifacts in pixel art games