Android NDK处理用户交互事件(4)

if (state->savedState != NULL) {
        // We are starting with a previous saved state; restore from it.
        engine.state = *(struct saved_state*)state->savedState;
    }

int ident, events;
    struct android_poll_source* source;

while (true)
    {
        while ((ident = ALooper_pollAll(0, NULL, &events, (void**)&source)) >= 0)
        {
            if (source != NULL)
                source->process(state, source);

if (state->destroyRequested != 0)
                return;
        }

engine_draw_frame(&engine);
    }

}

效果如图所示。

Android NDK处理用户交互事件

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/706aa2db62d972e5ef66183277443fa7.html