加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

cocos2dx applicationWillEnterForeground 出错

发布时间:2020-12-14 20:35:46 所属栏目:百科 来源:网络整理
导读:问题: 在AppDelegate::applicationWillEnterForeground()代码中显示了一个对话框,结果从后台切换会前台时,出现 call to OpenGL ES API with no current context (logged once per thread)错误。 解决: Don't call it in AppDelegate::applicationWillEnt

问题:

在AppDelegate::applicationWillEnterForeground()代码中显示了一个对话框,结果从后台切换会前台时,出现

call to OpenGL ES API with no current context (logged once per thread)错误。


解决:

Don't call it inAppDelegate::applicationWillEnterForeground. Because OpenGL context will be lost when enter to background. At this time OpenGL context may not be re-create by Android system. So,please do the operation after it is totally enter foreground.(摘自网络)


AppDelegate::applicationWillEnterForeground中启动一个定时器,延时一段时间(0.1,具体时间可能需要使用不同手机测试,确定)再显示对话框,结果就可以。


参考:

http://discuss.cocos2d-x.org/t/call-to-opengl-es-api-with-no-current-context-logged-once-per-thread/12345/3

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读