资源列表

  1. 官网上下载最新的cocos2d-x-3.3
  2. 安装JDKEclipseCDT插件ADT插件
  3. 下载Android SDK,更新。因为国内经常访问不了google,用vpn速度也有点慢。网上搜来的ip还可以用,改hosts文件。210.242.125.108    dl-ssl.google.com
  4. 下载NDK
  5. 下载ANT
  6. 安装VS2013
  7. 安装python 2.7

最终环境是:

  1. VS2013;
  2. python 2.7.8;
  3. ant-1.9.4;
  4. cocos2d-x-3.3;
  5. Eclipse Luna Service Release 1 (4.4.1);
  6. CDT 8.5.0;
  7. Android NDK, Revision 10;
  8. JDK (Java SE 8u25).

PC环境开发

命令行到cocos2d-x-3.3的目录,执行setup.py,填好ANT、NDK、SDK的安装/解压目录,结束。

用setup.py配置好Cocos2d-x的环境之后,你的命令行中就会多如“cocos”的命令,新建项目将使用这个命令进行。示例:

 cocos new hello(项目名称)-p com.hello(包名字)-l cpp(项目类型) -dF:\(目录)

进入项目目录,结构如图。

进入proj.win32,打开.sln文件(会自动关联vs2013),编译之后应该可以运行。

在这里卡了一段时间,因为实验室的机器没有独显,带的集显又不支持OpenGL,所以glfwCreateWindow返回值为null。

无奈在自己笔记本搭建环境,一步到位。

Android环境开发

eclipse的ADT插件可以导入android项目,然后run as android application就行。

模拟器的话,用2.3.3的虚拟机不能启动,会报错。java.lang.IllegalArgumentException: No configs match configSpec

主要原因见stackoverflow

This is actually part of a bigger issue, and I'm hoping that by posting here, others who have experienced this error will read this entry. I equally hope that, if any of my conclusions are incorrect, someone comes forth with a more definitive explanation and/or solution.
The core issue is OpenGL support. Beginning at 2.2, Android supports OpenGL ES 2.0, and beginning at 4.0.3, Android emulators support OpenGL ES 2.0. Code that uses OpenGL ES 2.0 will not work on emulators before 4.0.3. [Evidently, the camera switched from ES 1.0 to 2.0 at Android 2.2]
But that's not all! None of the Android docs I've encountered mention that, in order to support Open GL ES 2.0 emulation, your box's graphic card chipset and driver must support OpenGL 2.0 as well. Therefore, if you enable GPU Emulation on the AVD and you still encounter this error, do the following:

  • Find out the specs on your graphic card and visit the chipset manufacturer's web site to determine if the chipset is OpenGL 2.0 compatible. If it isn't, you're S.O.L. and must stick to debugging through an actual Android device instead of an emulator.
  • Determine if you have the latest graphics driver for the chipset. Drivers obtained through Microsoft (if you're using Windows) typically do not support OpenGL, so you want to download the latest driver from the manufacturer.

我用了真机(HTC G10)可以跑起来;

Cocos2d-x环境搭建的更多相关文章

  1. cocos2d ios 环境搭建

    一.下载cocos2d-x http://cocos2d-x.org/projects/cocos2d-x/wiki/Download cocos2d-x-2.1.4.zip @ June.18, 2 ...

  2. Cocos2d Android 环境搭建

    1.在开始之前,需要先准备好资源如下,如果安卓开发环境有了直接装第3.4. 1.JDK      点击下载 (1.6) 2.ADT(已经自带Android SDK)点击下载 3.NDK 点击下载 4. ...

  3. Mac下搭建cocos2d 和cocos2d -x 环境

    来源:http://blog.csdn.net/duxinfeng2010/article/details/7985024 cocos2d是一个开源框架,用于构建2D游戏.演示程序和其他图形界面交互应 ...

  4. 【Cocos2d入门教程一】Cocos2d-x环境搭建

    在进行Cocos2d游戏开发前 我们先来配置一下环境,我们先来准备一下工具,我们所需要的工具分别为: 1.Cocos2d引擎 2.JDK 3.SDK 4.NDK 5.ANT 6.ADT 1.下载Coc ...

  5. cocos2d-x Android 环境搭建问题汇总

    初次接触Cocos2d-x,准备搭建一个hello world的Android环境,问题遇到很多.在此记录,为自己,也为大家,避免重走弯路! 具体的环境搭建,可以参考官方的文档.在Windows7平台 ...

  6. [wp8游戏] cocos2d-x v2.2 + VS2013 环境搭建

    [wp8游戏] cocos2d-x v2.2 + VS2013 环境搭建 by:唐小崇 http://www.cnblogs.com/tangchong 从cocos2d-x v2.1.4 以来,co ...

  7. Cocos2d-x 3.0正式版及android环境搭建

    开发环境是:mac + xcode + eclipse ,在win以下的环境和这个都是一样的,唯一不一样的就是环境变量的配置. 以下主要介绍cocos2d-x环境的设置以及android的环境搭建 1 ...

  8. eclipse开发cocos2dx 3.2环境搭建之中的一个: Android C\C++环境搭建(ndk r9d)

    这几天有时间,琢磨一下cocos2dx.cocos2d家族事实上挺庞大的.也有cocos2d-android这样的能够直接用Java语言来开发的,可是cocos2d-android资料相对少一些.并且 ...

  9. Cocos2d-X-3.0 之后的版本的环境搭建

     Cocos2d-X-3.0 之后的版本的环境搭建 由于cocos2d游戏开发引擎更新十分频繁,官方文档同步不够及时和完善.所以不要照着官方文档来照做生成工程. <点击图片就能进入网站> ...

  10. Win8.1下COCOS2D-X 3.4环境搭建

     Cocos2dx_3.4开发环境搭建,并编译成APK 第一步:须要下载的:(windows64位系统下环境搭建) Ant   apache-ant-1.9.4-bin.zip NDK   and ...

随机推荐

  1. POJ 2549 二分+HASH

    题目链接:http://poj.org/problem?id=2002 题意:给定一个n个数字组成的序列,然后求出4个数使得a+b+c=d,求d的最大值.其中a,b,c,d要求是给定序列的数,并且不能 ...

  2. css/js(工作中遇到的问题)-3

    设置宽高比 使用padding/margin-top/bottom; 设置出教准确的自适应布局; 用于预加载图片; 关于数据库设置 添加extra对象用于扩展; 添加type类型; 对于字体 使用百分 ...

  3. HTML5(常用的表单控件)

    常用的HTML5的表单控件: Input 类型: color color 类型用在input字段主要用于选取颜色,如下所示: 从拾色器中选择一个颜色: 选择你喜欢的颜色: <input type ...

  4. DFS Codeforces Round #290 (Div. 2) B. Fox And Two Dots

    题目传送门 /* DFS:每个点四处寻找,判断是否与前面的颜色相同,当走到已走过的表示成一个环 */ #include <cstdio> #include <iostream> ...

  5. linux 添加新硬盘的方法

    在服务器上把硬盘接好,启动linux,以root登陆. 比如我新加一块SCSI硬盘,需要将其分成三个区: #fdisk /dev/sdb 进入fdisk模式: Command (m for help) ...

  6. TODO软件工程--如何预算项目的工期

    我的项目后台接口已经开发好,是前人留下的接口,现在只需要和前端联调,本以为后台的开发周期短,可以提早上线,可以因为旧接口不兼容新的要求 不得不重新写,造成了工期的延误. 如何计算一个工期被提上日程.

  7. BZOJ4635 : 数论小测验

    第一问: 设$a[i]$表示使用$[1,i]$的数字$n$次形成的数组里有多少个$\gcd=1$. 考虑容斥,则$a[i]=i^n-\sum_{j=2}^i a[\lfloor\frac{i}{j}\ ...

  8. Spring In Action ②

    初始化和销毁Bean init-method && destory-method <bean id="auditorium" class="test ...

  9. IE下margin:0 auto为什么不居中?

    http://blog.sina.com.cn/s/blog_68c6be330101k7kn.html 我们经常用DIV+CSS布局网页的时候,正常情况下需要将div居中显示时,使用Css样式:ma ...

  10. js的隐含参数(arguments,callee,caller)使用方法

    在提到上述的概念之前,首先想说说javascript中函数的隐含参数: arguments arguments 该对象代表正在执行的函数和调用它的函数的参数.[function.]arguments[ ...