trò chơi cocos2d-x của tôi gặp sự cố khi nhập vào nền. đây là một số mã từ appdelegate:trò chơi cocos2d-x gặp sự cố khi nhập nền
// This function will be called when the app is inactive. When comes a phone call,it's be invoked too
void AppDelegate::applicationDidEnterBackground()
{
CCDirector::sharedDirector()->pause();
CCUserDefault::sharedUserDefault()->flush();
CocosDenshion::SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground()
{
CCDirector::sharedDirector()->resume();
CocosDenshion::SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
}
và thông báo lỗi:
libGPUSupportMercury.dylib`gpus_ReturnNotPermittedKillClient:
0x3797e094: trap
0x3797e096: nop
lưu ý rằng nó luôn luôn treo dành cho iPhone, nhưng 99% tai nạn trên Android (okay khi trận đấu đã không tải lớn images etc)
EDIT: Tôi đã thử CCDirector :: sharedDirector() -> stopAnimation() và nó hoạt động tốt cho iOS. Nhưng vẫn bị treo cho Android (không phải ngay lập tức. Khi quay trở lại ứng dụng, màn hình trở nên đen (nhưng tôi nghĩ nó vẫn chạy vì nhạc nền vẫn đang phát. Sau đó khoảng 5 giây sau đó nó bị treo)
EDIT 2: thông báo lỗi trong Eclipse:.
libEGL call to OpenGL ES API with no current context (logged once per thread) (red warning text)
libc Fatal signal 11 (SIGSEGV) at 0x5f012000 (code=2) (black text)
tôi gọi là ccdirector :: sharedDirector() -> stopAnimation() và nó hoạt động tại – OMGPOP
xin lỗi, treo cho android bây giờ. ios là ok – OMGPOP
@OMGPOP Tôi đề nghị bạn thực hiện hai câu hỏi riêng biệt vì các lý do cho sự cố sẽ khác nhau chắc chắn. Tôi đoán là có một cuộc gọi lại khác trong Android, nơi bạn phải ngừng cập nhật GPU nhưng bạn không nhận được cuộc gọi lại. –