Cocos2d on Qt

Hi there

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

http://projects.developer.nokia.com/cocos2d ( 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
Ahmed

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.

Regards.


Please,

Hi, Ahmed.

Just to complete my answer.

Suppose you’ve created a copy of

/cocos2dx/platform/win32

named

/cocos2dx/platform/qt

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

CCAccelerometer_win32.h
CCApplication_win32.cpp
CCApplication_win32.h
CCEGLView_win32.cpp
CCEGLView_win32.h
CCFileUtils_win32.cpp
CCImage_win32.cpp

to

CCAccelerometer_qt.h
CCApplication_qt.cpp
CCApplication_qth
CCEGLView_qt.cpp
CCEGLView_qt.h
CCFileUtils_qt.cpp
CCImage_qt.cpp

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.

Regards.


Please,

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:
Ahmed

Hi.

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.

Sorry.

Regards.


Please,

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.

Regards.


Please,

OK, guys, I have a cool stuff to show.
https://github.com/honghui/cocos2d-x/tree/QtPort
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 ?

Regards.


Please,

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?
Thanks

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.
http://www.dragonfiresdk.com/docs.html

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

There is this one http://www.mapeditor.org/. 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.

Regards.


Please,

@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:


Please,

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?