Cocos2d on Qt

Cocos2d on Qt
0.0 0


Hi there

this is it, no a complete cocos2d but some features ( Although the back-end is different, the front end is very similar) ( Full example is downloadable )

Why Cocos2d on Qt is important?

Qt now suuports most major platforms, so you properly going to have your game running on different platforms, writing your game once, without any modifications and releasing it to these OSes is simple, it supports

1 - Windows ( XP, Vista, 7, 8 … )
2 - Mac OSX
3 - Linux ( ubuntu, fedora )
4 - Symbian
5 - Android
6 - Windows CE
7 - iOS (iPhone, iPod and iPad)
8 - Coming soon ( Windows phone, yet not confirmed )

So why not, if this project gets larger and larger, we’ll have a great game engine, that you write your code once, and then deploy your game on different platforms with 0% port effort, I’ve personally tested the Qt port for iOS and Android, and I can tell that it’s amazing

Best wishes

Noob question about rendering in a GUI

Hi, Ahmed.

First of all I want to thank you for your effort. I really appreciate what you’re doing.

I saw the source code and it’s not in the same standard as other platforms on cocos2d-x.

Even the public interface used by developers to create games are different.

Shouldn’t you:

  • clone cocos2d-x source code

  • goto /cocos2dx/platform create a copy win32 folder and change it’s code to use QT APIs instead of win32 API?

This way:

  • you would have less code to develop (it would be possible to compile QT source to Symbian using Nokia’s SDK)

  • you would have more people interested to use your code.

  • it would let your code be integrated to official cocos2d-x source code tree.

Again, please, don’t get me wrong.

I know you’re putting a big effort and time to help community.

I’m just sharing my point of view because I’d like to see a QT port of cocos2d-x (you can see my idea about it here) but I wouldn’t want to learn another API and I guess many users think the same way.




Hi, Ahmed.

Just to complete my answer.

Suppose you’ve created a copy of




Then you would rename the _win32 part of the file names inside the qt folder:




and replace their implementation (that uses win32 API) with other that uses QT API.

Walzer and Minggo know better than me. They can correct me and guide you to the best way you can focus your efforts.




Hi Marcio,

I was trying to do what you’ve told me with no success because of my knowledge in OpenGL.

If you want to help me to try, let me know by adding me to a chat software like :

Skype:  q8spirit
MSN: q8.g@msn.Com

Or any other :slight_smile:

bests :slight_smile:



Unfortunately I’m not only a bad programmer that don’t know OpenGL.

I’m a bad programmer that don’t know OpenGL and that suffer with tendinitis.





Ahmed, there are two very interesting projects from BogDan Vatra:

Both projects are derived form QT lighthouse project.

As both projects have to deal with OpenGL integration, there are two possibilities:

1 - BogDan Vatra worked by himself to solve OpenGL integration;

2 - BogDan Vatra used something from lighthouse project to handle this.

Maybe it worth you ask him and check how these projects solved this OpenGL problem.




OK, guys, I have a cool stuff to show.
Honghui Zhang, one of my collaborator, is working on port cocos2d-x for Qt for several months, and our goal is to create an Editor with it eventually.
His Qt port is semi-finished, cocos2d-x/platform part is done while 3rd-party libraries are haven’t. This Qt port can run on windows now, linking 3rd-party libraries of win32 port.
We can continue the job from here :slight_smile:


Walzer, you always have good news.

Sorry but I didn’t understand what you mean when you said:

our goal is to create an Editor with it eventually.

Do you want to create an editor (other than QtCreator) or do you want to create a project to use QtCreator ?




Amazing Walzer! Can’t wait!


@Marcio, I mean an action editor for cocos2d, it must can run on both windows + osx, and perhaps ubuntu.


If you’re already doing OSXand win32, why ‘perhaps’ Ubuntu? If Qt is good in something it’s multiplatform compatibility. I wouldn’t hesitate if I were you.

Ubuntu QT port = awesome.


Oh, that’s great. I’m not familiar with Qt and Ubuntu.
If Qt apps can run on these desktop systems seamlessly, it would be easy to distribute different versions, just like TileMap.


Is that meant we can debug on iphone in Windows platform, without the need of MacOS machine?


Cocos2d is a framework, so you still need a mac to build and distribute your ios game.


Walzer Wang wrote:

Cocos2d is a framework, so you still need a mac to build and distribute your ios game.

DragonFireSDK can do deploy in Windows and so I expected it could be done by other tools.


`Walzer Instead of write on tile map editor, wouldn’t be better to pick an existing one?

There is this one It’s writing with Qt so it can run on Windows, Mac and Linux.

Tiled is an open source project.

`Dany I agree with you.




@Marcio, you misunderstood my meaning. We gonna to make a n editor focus on layout and actions, and the final goal is to achieve skeleton animation feature. Without an editor, skeleton animation support in engine is meaningles. But the editor should run on windows and osx, so it should base on Qt.


I think he means you will get a QT WYSIWYG editor where you can edit the way your game behaves.


@Walzer Yes, I really misunderstood what you mean. Sorry.

Anyway, when multi-platform and C++ are requirements Qt is always the best choice :wink:



Great work Walzer!

Now I just want to make a tool both for windows and mac os. Now I’m trying to use QT for UI, and some cocos2d-x features.
I think the qt-port is really worth to do!
btw, what do you mean by the ‘action editor’? like animation editor? Can you explain it more?