摘要: 版本:3.0Beta2在android上,触摸事件的原始起点在nativeactivity分发出去。例如:cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &pointerId, &x, &y);总共有几下几种,在EGLView当中,实现了 virtual void handleTouchesBegin(int num, int ids[], float xs[], float ys[]); virtual void handleTouchesMove(int n 阅读全文
posted @ 2014-03-06 17:51 风亦兮 阅读(1000) 评论(0) 推荐(0) 编辑
摘要: 在前面的engine_draw_frame的函数中,可以看到每一帧都调用了cocos2d::Director::getInstance()->mainLoop()方法,接下来,去看些循环中具体做了什么void DisplayLinkDirector::mainLoop(){ if (_purgeDirectorInNextLoop) { _purgeDirectorInNextLoop = false; purgeDirector(); } else if (! _invalid) { drawScene(); ... 阅读全文
posted @ 2014-02-24 12:02 风亦兮 阅读(717) 评论(0) 推荐(0) 编辑
摘要: 最近面试六,七家公司的cocos2d-x游戏开发工程师。才发现,自己在编程上的不足,虽然,我在编程方面的实践上没有问题的,但C++语言的细节,还了解不够,自己的算法也较薄弱。所以打算今年从以下方面增强下: 仔细阅读《Effective C++》这本书 提升算法,看《编程珠玑》或者《算法导论》 分析cocos2d-x,lua的源码,并写博客 了解openGL 阅读全文
posted @ 2014-02-23 19:47 风亦兮 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 版本:cocos2d-x 3.0 Beta分析的是android部分的源码在cocos2d-x自动生成的android部分,下jni目录,main.cpp是java调用的部分,代码如下void cocos_android_app_init (struct android_app* app) { LOGD("cocos_android_app_init"); AppDelegate *pAppDelegate = new AppDelegate();}在这个版本中,android部分使用了nativeActivity在cocos\2d\platform\android目录下, 阅读全文
posted @ 2014-02-21 16:29 风亦兮 阅读(2335) 评论(0) 推荐(0) 编辑
摘要: 前段时间做了一个数据解析的问题.在将二制流数据转换到short类型时出现问题.经过排查,endStart是const char*类型short cxls=*endStart; //这样写是有问题的,这样转换,其实只是将内存中前面1个字节的值赋给了cxls正确应该这样写short cxls=*((short*)endStart); 阅读全文
posted @ 2013-08-20 10:59 风亦兮 阅读(548) 评论(0) 推荐(0) 编辑
摘要: http://cocos2d-x.org/projects/cocos2d-x/wiki/Release_Node_v300 阅读全文
posted @ 2013-08-01 09:02 风亦兮 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 在android中使用POSIX线程1、在Android.mk中LOCAL_C_INCLUDES += system/core/include/cutils线程库的头文件在这里。2、在Android.mk中LOCAL_SHARED_LIBRARIES := libcutil3、程序中加入 include threads.h 阅读全文
posted @ 2013-06-19 15:13 风亦兮 阅读(6277) 评论(0) 推荐(0) 编辑
摘要: 环境是在阿里云ubuntu 12.04 64位1.apt -get update2.apt-get install nginx修改配置文件:在/etc/nginx/sites-available/default 目录下,修改成如下的# You may add here your# server {# ...# }# statements for each of your virtual hosts to this file### You should look at the following URL's in order to grasp a solid understanding# 阅读全文
posted @ 2013-05-19 10:19 风亦兮 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 为了能使mysql能够外部被访问,根据网上的方法用遍了,还是有如下错误:Lost connection to MySQL server at 'reading initial communication packet', system error: 0只好自己独立安装个mysql ,果然能连上了mysql安装方法:sudo apt-get install mysql-serversudo apt-get install mysql-clientsudo netstat -tap | grep mysql当您运行该命令时,您可以看到类似下面的行:tcp 0 0 localhost 阅读全文
posted @ 2013-05-18 20:12 风亦兮 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 使用的系统是ubuntu 12.04 64位首先安装php运行环境,使用lnmp,按照下面http://lnmp.org/install.html安装成功之后,安装redis一条命令就行了:apt-get install redis-server安装redis的php扩展1.sudo wget http://open.imop.us/pr.tar.gz2.tar zxvf pr.tar.gz //解压3. cd owlient-phpredis-5a07edc4./usr/local/php/bin/phpize5./configure --with-php-config=/usr/lo... 阅读全文
posted @ 2013-05-13 09:31 风亦兮 阅读(1835) 评论(0) 推荐(0) 编辑