MCPcopy Create free account
hub / github.com/defold/defold / WaitForWindow

Function WaitForWindow

engine/engine/src/engine_main.cpp:78–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78static int WaitForWindow()
79{
80 while (glfwAndroidWindowOpened() == 0)
81 {
82 void* data = NULL;
83 int ident = ALooper_pollOnce(300, NULL, NULL, &data);
84
85 struct android_app* app = dmAndroid::GetAndroidApp();
86 assert(app);
87
88 if (ident >= 0 && data != NULL) {
89 struct android_poll_source* source = (struct android_poll_source*)data;
90 source->process(app, source);
91 }
92 if (ident == ALOOPER_POLL_ERROR) {
93 dmLogFatal("ALooper_pollOnce returned an error");
94 return 0;
95 }
96
97 glfwAndroidFlushEvents();
98 if (app->destroyRequested) {
99 return 0;
100 }
101 dmTime::Sleep(300);
102 }
103 return 1;
104}
105
106int engine_main(int argc, char *argv[])
107{

Callers 1

engine_mainFunction · 0.70

Calls 6

glfwAndroidWindowOpenedFunction · 0.85
glfwAndroidFlushEventsFunction · 0.85
GetAndroidAppFunction · 0.50
assertFunction · 0.50
SleepFunction · 0.50
processMethod · 0.45

Tested by

no test coverage detected