|
@@ -55,6 +55,8 @@
|
|
|
#include "ios/ios.h"
|
|
#include "ios/ios.h"
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+#include "pthread.h"
|
|
|
|
|
+
|
|
|
#ifdef OXYGINE_SDL
|
|
#ifdef OXYGINE_SDL
|
|
|
extern "C"
|
|
extern "C"
|
|
|
{
|
|
{
|
|
@@ -98,6 +100,8 @@ namespace oxygine
|
|
|
|
|
|
|
|
spEventDispatcher _dispatcher;
|
|
spEventDispatcher _dispatcher;
|
|
|
|
|
|
|
|
|
|
+ static pthread_t _mainThread;
|
|
|
|
|
+
|
|
|
#ifdef __S3E__
|
|
#ifdef __S3E__
|
|
|
|
|
|
|
|
int32 pointerEvent(void* sysData, void* u)
|
|
int32 pointerEvent(void* sysData, void* u)
|
|
@@ -213,6 +217,15 @@ namespace oxygine
|
|
|
#endif
|
|
#endif
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ bool isMainThread()
|
|
|
|
|
+ {
|
|
|
|
|
+#ifdef OX_NO_MT
|
|
|
|
|
+ return true;
|
|
|
|
|
+#else
|
|
|
|
|
+ return pthread_equal(_mainThread, pthread_self()) != 0;
|
|
|
|
|
+#endif
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
#ifdef EMSCRIPTEN
|
|
#ifdef EMSCRIPTEN
|
|
|
void SDL_handleEvent(SDL_Event& event, bool& done);
|
|
void SDL_handleEvent(SDL_Event& event, bool& done);
|
|
|
int SDL_eventsHandler(void*, SDL_Event* e)
|
|
int SDL_eventsHandler(void*, SDL_Event* e)
|
|
@@ -419,7 +432,10 @@ namespace oxygine
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
- LoadResourcesContext::init();
|
|
|
|
|
|
|
+
|
|
|
|
|
+#ifndef OX_NO_MT
|
|
|
|
|
+ _mainThread = pthread_self();
|
|
|
|
|
+#endif
|
|
|
init2();
|
|
init2();
|
|
|
|
|
|
|
|
return 1;
|
|
return 1;
|