位置: 编程技术 - 正文

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

  • 非税收入票据可以手写吗
  • 注册税务师报名条件
  • 专项工程支出计入什么科目
  • 以前年度多交增值税
  • 税率如何衡量税负
  • 小规模发票单张限额
  • 摄影服务的开票项目
  • 有期末留抵税额增值税和附税还用计提和缴纳吗
  • 财产租赁所得适用什么税率
  • 收取返利发票怎么开具?
  • 公司章程上的出资时间2050年
  • 不开发票的收入怎么处理?
  • 混合销售行为如何界定
  • 转销无形资产的处置流程
  • 少缴纳社保怎么要求支付赔偿金
  • 以前年度损益调整会计分录
  • 一般纳税人开专票和普票的税率
  • 代开的专票作废了怎么做账?
  • 水电费的增值税计入什么科目
  • 第三方软件测评费的取费标准
  • 华硕笔记本电脑售后维修服务网点
  • 惠普笔记本电源适配器
  • 土地拍卖资金交到哪里
  • 员工加班车费会计分录
  • 股票发行费用怎么处理
  • codeigniter 教程
  • node.txt
  • 伯里圣埃德蒙兹的人口
  • 2023最新最全的祈祷视频
  • 企业其他应付款太多怎么办
  • 毕业设计基础
  • vue destroyed销毁组件
  • php实现多语言切换
  • 著作权费用
  • 社保费怎么做记账凭证
  • php首页
  • 人力资源公司开票税目
  • 购买一台电脑2400元贵吗
  • 一次性计提和一次性支付的区别
  • 发票超额怎么办
  • 企业年金是否要交个税
  • 会计人员未参加继续教育
  • 土地使用税减免税优惠
  • 商场扣点怎么做分录
  • 对公可以转个人账户货款吗
  • 法院去单位直接扣划单位薪酬
  • 购进材料入库,其价税款通过银行支付
  • 抵账的车买了什么后果
  • 预提福利费
  • 财产租赁合同印花税怎么缴纳
  • 建筑业营改增后税率变化
  • 小规模减半征收房产税文件
  • 商品流通企业如何控成本
  • 什么是现金流量表分析的重点
  • sql server批量导入数据
  • win10 mobile 预览10240
  • deepin-win
  • win8应用商店废了
  • 如何检测电脑能否上网
  • win10注销系统会怎么样
  • w8系统文件夹怎么设置密码
  • win10系统笔记本怎么连接wifi
  • win10系统自定义设置
  • 如何汉化游戏
  • 遮罩层在上还是在下
  • Extjs中DisplayField的日期或者数字格式化扩展
  • 怎么重置mysql的密码
  • python下读取公私钥做加解密实例详解
  • node.js开发实战
  • java性能调优实战 网盘
  • python爬虫代理ip巨量http 代理8元/日
  • jQuery dataTables与jQuery UI 对话框dialog的使用教程
  • javascript运用
  • bootstrap的组件
  • jquery中追加到指定元素末尾
  • jquery控制display属性
  • 境外付汇税务备案要多久
  • 佛山国家税务局招聘
  • 增值税已申报但是忘清卡
  • 企业税收筹划的最终目的
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设