summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/entry/entry_android.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/common/entry/entry_android.cpp')
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_android.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry_android.cpp b/3rdparty/bgfx/examples/common/entry/entry_android.cpp
index b1e7266b623..78c9dccbefa 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_android.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_android.cpp
@@ -110,7 +110,7 @@ namespace entry
const char* argv[1] = { "android.so" };
m_mte.m_argc = 1;
m_mte.m_argv = const_cast<char**>(argv);
-
+
while (0 == m_app->destroyRequested)
{
int32_t num;
@@ -140,7 +140,7 @@ namespace entry
// Command from main thread: a new ANativeWindow is ready for use. Upon
// receiving this command, android_app->window will contain the new window
// surface.
- if (m_window == NULL)
+ if (m_window != m_app->window)
{
m_window = m_app->window;
bgfx::androidSetWindow(m_window);
@@ -152,7 +152,10 @@ namespace entry
WindowHandle defaultWindow = { 0 };
m_eventQueue.postSizeEvent(defaultWindow, width, height);
- m_thread.init(MainThreadEntry::threadFunc, &m_mte);
+ if (!m_thread.isRunning() )
+ {
+ m_thread.init(MainThreadEntry::threadFunc, &m_mte);
+ }
}
break;