`
song020cn
  • 浏览: 61888 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Cocos2dx setup Eclipse environment for Android

阅读更多

Notes for porting cocos2dx games from iOS to Android:

- create-android-project.sh

- eclipse > new project from existing code

- add NDK_ROOT variable in eclipse (build_native.sh need to define NDK_ROOT, otherwise will report "Please define NDK_ROOT")
NDK_ROOT    "path.to/android-ndk-r8b"

- make eclipse able to compile c++
New > Others > Convert to c/c++ project

- setup build path
bash path.to/build_native.sh NDK_DEBUG=1 V=1

- add include path: C++ General > Path and symbols
$(COCOS2DX_HOME)/cocos2dx
$(COCOS2DX_HOME)/cocos2dx/include
$(NDKROOT)/platforms/android-9/arch-arm/usr/include
$(workspace_loc)/Classes

- add c++ classes
link from source

- Build all (this will build the c++ library)


- Run As (this will pack the apk using jni)



Note:
- create AVD > enable GPU emulation for OpenGL ES2.0 support (start from Android 4.03)
- upon test I'm still not able to run OpenGL ES2.0 in emulator, but deploy to real device will work

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics