It looks like whoever wrote this just kept adding draw calls until it worked. For some reason if I removed the call from APP_CMD_INIT_WINDOW (which really shouldn't have needed to render), or added an if (!animating) early exist to engine_draw_frame, it would prevent the app from ever rendering. I never figured out why, but in any case the most important call is the one that was missing: the one in APP_CMD_GAINED_FOCUS. That's why the rendering wouldn't start until you tapped the screen. I added that and now all the calls that appear superfluous in fact are.
It looks like whoever wrote this just kept adding draw calls until it worked. For some reason if I removed the call from
APP_CMD_INIT_WINDOW
(which really shouldn't have needed to render), or added anif (!animating)
early exist to engine_draw_frame, it would prevent the app from ever rendering. I never figured out why, but in any case the most important call is the one that was missing: the one inAPP_CMD_GAINED_FOCUS
. That's why the rendering wouldn't start until you tapped the screen. I added that and now all the calls that appear superfluous in fact are.Depends on https://github.com/android/ndk-samples/pull/1005.