位置: 编程技术 - 正文

cocos2dx onpause崩

编辑:rootadmin

推荐整理分享cocos2dx onpause崩,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

原文: encountered a crash issue that, when you tried to install apk and start it from Eclipse, the game will surely crash with an assertion error if your phone’s screen is off. Here is the reason I found:When the phone screen is off, android will call onCreate, onResume, then onPause in order. While in onPause, Cocos2dxRenderer.nativeOnPause will be called. So see the code below:

JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnPause() {CCApplication::sharedApplication()->applicationDidEnterBackground();CCNotificationCenter::sharedNotificationCenter()->postNotification(EVENT_COME_TO_BACKGROUND, NULL);}

Cocos2dxRenderer.nativeOnPause will attempt to call applicationDidEnterBackground() of the current application. But it is NULL: because while the screen is off, android won’t draw anything so that Cocos2dxRenderer.nativeInit isn’t called, and AppDelegate won’t be created.But why the app don’t crash in onResume? I compared the native code of Cocos2dxRenderer.onResume:

cocos2dx onpause崩

JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnResume() {if (CCDirector::sharedDirector()->getOpenGLView()) {CCApplication::sharedApplication()->applicationWillEnterForeground();}}

I found a check before calling applicationWillEnterForeground(), this prevent calling applicationWillEnterForeground() while the application is not created.

I wonder why the implementation won’t check getOpenGLView() in onPause but in onResume only?

The issue above won’t effect much for the end-user, because they always launch your game with screen on. But it might lead to crash on some auto test system…

cocos2dx3.2 xcode中资源路径设置问题 在xcode中,将资源分类,然后将各自的文件夹添加到Resources,运行程序的时候老是报错,说是找不懂资源,原因就是找不到资源路径。那么如何设置呢?1

Bullet(Cocos2dx)之封装PhysicsWorld3D Bullet3之封装PhysicsWorld3D根据bullet3HelloWorld程序去封装一个PhysicsWorld3D,首先应该去创建一个物理世界,而对于一个物理世界,默认都有重力,提供一个创

浅谈cocos2dx手游开发CPU发热严重之见 猜测它有可能是在主循环里使用了Sleep(0),一搜,果然定位到具体代码,它位于cocos2dxplatformwinCCApplication.cpp,大致长像如下:1while(1){2if(有消息){3if(时

标签: cocos2dx onpause崩

本文链接地址:https://www.jiuchutong.com/biancheng/372621.html 转载请保留说明!

上一篇:cocos2dx 3.2 读写XML,基于tinyxml2封装的易使用,更灵活的XML接口。中文国际化。(cocos creator读取json)

下一篇:cocos2dx3.2 xcode中资源路径设置问题

  • 怎么算一般纳税人
  • 什么是节税?
  • 房地产项目公司是什么意思
  • 房产交房前开发商要办齐的手续
  • 红字信息表已核销不允许撤销
  • 房地产企业还有未来吗
  • 直系亲属之间转账要交税吗
  • 待认证进项分录
  • 支付收购股权款如何做账
  • 企业基本保险
  • 二手车公司销售二手车的税率
  • 非税收入一般缴款书可以抵扣吗
  • 支付的劳务派遣费计入什么科目里
  • 10个点的发票税点开6个点专票
  • 建筑施工的会计科目
  • 进项税额异常补税怎么算
  • 一般纳税人普通发票要交增值税吗
  • 简易计税视同销售如何处理?
  • 事业基金弥补收支差额
  • 交通票报销有哪些
  • 专用发票不报销对公司有影响吗
  • 4s店帮买保险后会哪些资料要给我的
  • 多转出的进项税怎么做账
  • 电脑bios设置最佳性能和默认
  • 开办费计入长期待摊费用汇算清缴时怎么填写
  • win11不显示桌面,但是有文件夹打开的标志是怎么回事
  • flash player用不了怎么办
  • 筹建期间费用计什么科目
  • rsmsink.exe - rsmsink是什么进程 有何作用
  • 进程cmd.exe
  • 承包合同包含的内容
  • 现金收入如何做账务处理
  • 看望员工生病的家属支付现金如何入账
  • elementui中的el-tab-pane为什么内容会为0
  • 企业收到对外投资收益交所得税吗
  • laravel 关联
  • 专票抵扣联可以盖两个章吗
  • 采购员出差预借差旅费300元
  • 《linux内核分析》
  • 接口多继承的写法
  • 计算机视觉中的数学方法
  • python 3.4.3 shell
  • 应付账款的会计含义
  • java拼接字符串和数字
  • 机关党建经费提取比例
  • 职工食堂的费用怎么入账
  • 税控系统如何清卡
  • 当月收入可以下月开票吗
  • sqlsever注释符号
  • 出口销售收入要交印花税吗
  • 临时工和正式工工资不一样违法吗
  • 取得费用报销单怎么填写
  • 公司代缴个税怎么做账
  • 通行费电子发票进项税额如何填报
  • 增值税进项税额抵扣期限最新
  • 基本生产成本和生产成本
  • 发票邮寄到家
  • 什么是合理的工作安排
  • mysql数据库中SELECT * FROM是什么
  • 当你感觉到你的win2000运行速度明显减慢
  • win8系统升级
  • win10访问局域网电脑需要用户名和密码
  • ubuntu系统安装报错
  • cleanmymac3激活码领取
  • win7更改文件名的方法
  • win8如何使用word
  • python如何精确小数
  • js实现日历可获得的信息
  • android studio string函数
  • Node.js中的全局变量有哪些
  • redhat linux8
  • js原生dialog
  • js 函数写法
  • unity data
  • jquery中的选择器有哪些
  • jquery 动态添加元素
  • substrate框架原理
  • 地下车库是否缴房产税
  • 广东税务局查验
  • 全国税务系统全面从严治党工作会议2023年
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设