Yesterday cocos2d-x announced they’re supporting Windows 8 Metro.
Many people would like to develop for iPhone, iPad and Mac but don’t have enough money to buy a Mac (me included). Continue reading “How to develop games for iPhone without a Mac”
Among many platforms, cocos2d-x let us develop for Blackberry Playbook.
Blackberry offers a simulator to ease development. Unfortunately my video card is rather old and my VM stops loading at the point shown in picture 1.
Amazing? Yes. You may be wondering why.
Let me tell the reason: it has 100 recipes ready for use.
There is no need to reinvent the wheel in order to solve day-to-day problems.
Cocos2d for iPhone 1 Game Development Cookbook is available in both print and digital forms.
When I get it I’ll write a review.
JNI is a knowledge anyone developing games with cocos2d-x must have. As I don’t known it enough to feel comfortable with the theme so I started studying it myself.
During my learning process I like to take notes and share what I’m discovering. This post aims to be an introductory text on JNI. I will try to teach you the basics so you can understand how it works and how to integrate your own Java / native code (C/C++).
It is essential when developing games for Android using cocos2d-x.
There are 2 scenarios when it comes to JNI:
- Java code calling native code (C/C++)
- Native code (C/C++) calling Java code.
I’ve upgrade from android-ndk r6 to r7 today and solved some problems I’ve found with awk.
After that I performed a full compilation on cocos2d-x’s HelloWorld to be sure everything else was ok.
I got an unpleasant surprise: it wasn’t.
The following errors show up:
jni/../../../cocos2dx/effects/CCGrabber.cpp: In constructor 'cocos2d::CCGrabber::CCGrabber()':
jni/../../../cocos2dx/effects/CCGrabber.cpp:46: error: 'glGenFramebuffersOES' was not declared in this scope
jni/../../../cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::grab(cocos2d::CCTexture2D*)':
jni/../../../cocos2dx/effects/CCGrabber.cpp:61: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../../cocos2dx/effects/CCGrabber.cpp:65: error: 'glFramebufferTexture2DOES' was not declared in this scope
jni/../../../cocos2dx/effects/CCGrabber.cpp:68: error: 'glCheckFramebufferStatusOES' was not declared in this scope
jni/../../../cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::beforeRender(cocos2d::CCTexture2D*)':
jni/../../../cocos2dx/effects/CCGrabber.cpp:88: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../../cocos2dx/effects/CCGrabber.cpp: In member function 'void cocos2d::CCGrabber::afterRender(cocos2d::CCTexture2D*)':
jni/../../../cocos2dx/effects/CCGrabber.cpp:113: error: 'glBindFramebufferOES' was not declared in this scope
jni/../../../cocos2dx/effects/CCGrabber.cpp: In destructor 'virtual cocos2d::CCGrabber::~CCGrabber()':
jni/../../../cocos2dx/effects/CCGrabber.cpp:127: error: 'glDeleteFramebuffersOES' was not declared in this scope
make: *** [obj/local/armeabi/objs-debug/cocos2d/effects/CCGrabber.o] Error 1
Today I’ve updated android-ndk from r6b to r7.
When I executed
on my Linux I got the following error message:
/home/plicatibu/local/sdk/android-ndk/prebuilt/linux-x86/bin/awk: 1: ELF: not found
/home/plicatibu/local/sdk/android-ndk/prebuilt/linux-x86/bin/awk: 4: Syntax error: word unexpected (expecting ")")
Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !
make: Entering directory `/home/plicatibu/local/sdk/cocos2d-1.0.1-x-0.9.2/HelloWorld/android'
/home/plicatibu/local/sdk/android-ndk/build/core/init.mk:258: *** Android NDK: Aborting. . Stop.
make: Leaving directory `/home/plicatibu/local/sdk/cocos2d-1.0.1-x-0.9.2/HelloWorld/android'
In the post Developing with cocos2d-x for android on Linux I told you how to compile your cocos2d-x and run it on Eclipse.
Now I’m going to tell you how to debug both cocos2d-x native code and Java using MOTODEV Studio for Android (You can use the instructions provided here with plain Eclipse with some extra effort).
Despite the fact I’m writing with cocos2d-x in mind, what I’m going to present here will let you debug any kind of native code mixed with Android / java.
These days I came across a project named cocos2d-x. It’s a port of cocos2d game engine to C++ that allow us to use the same source code to generate versions for iPhone, Android, MS Window (32 bits) and WoPhones.
In the wiki they explain how to develop for Android on both environments: MS Windows and MacOS.
On Windows you will need to install Cygwin. In my opinion, it’s not a good solution.
Cygwin will occupy a lot of space (around 2.6GB), it’s to slow to compile and it’s hard to debug android’s native code. It’s so hard that folks on cocos2d-x recommends you to develop you game for Windows and after that it gets up and running you compile it for android.
I love to develop on Linux, so when I decided to give a try on cocos2d-x I set up a Linux environment.
It’s what this post is about: how to compile cocos2d-x for android using a Linux distribution (as you may already guessed by the title of this post).
Continue reading “Developing with cocos2d-x for android on Linux”
I’m getting more and more confused about so many (amazing) options available for mobile development.