Merge pull request #5401 from natural-law/issue3540

Solve the bug: Sometimes RenderTexture not drawn after a background/foreground
This commit is contained in:
minggo 2014-02-20 14:46:26 +08:00
commit 196ab2caff
1 changed files with 6 additions and 4 deletions

View File

@ -585,14 +585,16 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd)
// The window is being hidden or closed, clean it up.
engine_term_display(engine);
break;
case APP_CMD_GAINED_FOCUS:
case APP_CMD_RESUME:
if (cocos2d::Director::getInstance()->getOpenGLView()) {
cocos2d::Application::getInstance()->applicationWillEnterForeground();
engine->animating = 1;
if (engine->display != nullptr)
{
engine->animating = 1;
}
}
break;
case APP_CMD_LOST_FOCUS:
case APP_CMD_PAUSE:
{
cocos2d::Application::getInstance()->applicationDidEnterBackground();
cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);