cocos2dx applicationWillEnterForeground 出错

cocos2dx applicationWillEnterForeground 出错,第1张

概述问题: 在AppDelegate::applicationWillEnterForeground()代码中显示了一个对话框,结果从后台切换会前台时,出现 call to OpenGL ES API with no current context (logged once per thread)错误。 解决: Don't call it in AppDelegate::applicationWill

问题:

在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

总结

以上是内存溢出为你收集整理的cocos2dx applicationWillEnterForeground 出错全部内容,希望文章能够帮你解决cocos2dx applicationWillEnterForeground 出错所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1048507.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存