int tick(lua_State *L) { #if JUCE_ANDROID return 0; #else bool r = MessageManager::getInstanceWithoutCreating()->runDispatchLoopUntil(0); if(!r){ LApp->shutdown(); lua_shutdown(L); } lua_pushboolean(L,r); return 1; #endif }
int start( lua_State *L ) { LUA::Set(L); LJUCEApplication *mc = Luna<LJUCEApplication>::check(L, 2); mainClass = mc; int rc = lua_main(); #if ! JUCE_ANDROID lua_shutdown(L); #endif DBG("END of START\n"); lua_pushnumber(L, rc); return 1; }
int start_manual( lua_State *L ) { LUA::Set(L); luaL_checktype(L, -1, LUA_TFUNCTION); // cb luaL_checktype(L, -2, LUA_TNUMBER); // sleep luaL_checktype(L, -3, LUA_TTABLE); // LJUCEApp int cb_ref = luaL_ref(L, LUA_REGISTRYINDEX); LJUCEApplication *mc = Luna<LJUCEApplication>::check(L, 2); // luaL_ref pop'ed the cb function mainClass = mc; int ms = luaL_checknumber(L, 3); lua_settop(L,0); int rc = lua_main_manual(L, cb_ref, ms); lua_shutdown(L); DBG("END of START (manual)\n"); lua_pushnumber(L, rc); return 1; }