位置: 编程技术 - 正文

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中资源路径设置问题

  • 核定征收需要缴税吗
  • 一般纳税人的税点
  • 关联方交易金额含税吗
  • 工程施工科目核算内容
  • 制造费用结转成什么
  • 保险中介的保险可以买吗
  • 行政划拨无偿取得发票
  • 停工损失会计科目
  • 少缴纳个人所得税的需要付什么责任
  • 社保公积金会计分录怎么写
  • 公益性捐赠需要缴纳增值税吗
  • 陕西省水利基金的税率
  • 利润表中利润归还投资
  • 销售费用广告费存在哪些问题
  • 来料加工的账务处理
  • 包装物租金怎么算
  • 预收账款预提费用是什么
  • 关于其他应收款账户的说法
  • 挂证不付工资只代缴社保账务处理
  • 银行汇票和银行本票区别图解
  • 折扣销售的定义
  • 财务报表的组成部分
  • 硬盘跳线设置
  • 金融业贷款损失多少
  • 坦桑尼亚塞伦盖蒂公园有什么动物
  • php获取访问用户的ip
  • 企业雇佣临时工个税
  • 建筑业预缴增值税
  • 进项税不得抵扣的意思
  • ech命令
  • yii2框架和fastadmin建商城网站哪个好用
  • 再次回归的成语
  • 增值税纳税申报实训报告
  • 应交税费月末要结平
  • dedecms 收费
  • sql优化方式
  • mongodb reactive
  • 应交税金科目的核算
  • 应付账款暂估款的账务处理
  • 预期损失el
  • 开票系统服务费计入什么费用
  • 在建工程进项税额抵扣最新通知
  • 转租单位房子合法吗
  • 老板从公司借款怎么处理
  • 公司发工资是私人转账的要交税吗
  • 出口退税免抵退税额要交城建税吗
  • 旅游业差额开票的票据可以累计一季度吗
  • 期初借款余额计算公式
  • 金蝶k3怎么打印科目余额表
  • 公司企业名称变更流程
  • 一般纳税人的进项税率是多少
  • 新成立的公司需要年检吗
  • mysql安装与配置的步骤与常用命令
  • 在sp_executesql中使用like字句的方法
  • win10预览版21277
  • win8无法连接wifi
  • 虚拟机怎么安装exe文件
  • ntdll.dll no matching
  • win7系统修改
  • windows更新驱动程序需要多久
  • 怎么远程登录另一台电脑
  • win10链接手机怎么用
  • win7蓝屏0x000000d1
  • redeonsoftware更新
  • win10预览版21301bug
  • 11月 Win8.1 Update 3更新哪些内容?开始菜单依然没有
  • 安卓软件集
  • cocos2dx schedule
  • javascript中的数据类型分为两大类
  • 【ExpandableListView】ExpandableListView互斥展开效果
  • c#中thread的用法
  • 歺包做法
  • Python Requests 基础入门
  • 国家税务总局广东省税务局待遇
  • 国家税务局几号上班
  • 重庆税务局发票作废怎么处理
  • 江苏税务缴费小程序
  • 个人所得税app可以更改电话号码吗
  • 江苏房产税如何计算公式
  • 河南省税务局领导班子名单
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设