Reputation: 141
I'm normaly using QtCreator for c++ and I have Linux. I want to write a game in Cocos2dx. I installed Cocos2dx without problem, created HelloWorld using "cocos new", opened it with QTC and builded it. Everything is ok. BUT Cocos2dx uses cmake. When I create new class in project in Qt Creator I can't see it. So which ide is useable for cocos2dx? I tried VS 2013 but i don't like Windows. (pls sorry for my bad English, I hope you will understand)
Upvotes: 4
Views: 2633
Reputation: 1
I'm using Clion https://www.jetbrains.com/clion/ and it works fine with cocos2dx. Just open folder which contains CMakeLists.txt.Created classes are automaticaly updated in CMakeLists.txt by ide.
Upvotes: 0
Reputation: 550
In QTCreator you need to add new sources to your project's root CMakeLists.txt and then run cmake again. After doing this you can see your new classes.
Suppose we have AppDelegate.cpp and MainMenuScene.cpp and want to add NewScene class (defined in NewScene.h and NewScene.cpp). Then in MyGame/CMakeLists.txt find "set(GAME_SRC" and add NewScene.cpp and NewScene.h files as below:
set(GAME_SRC
Classes/AppDelegate.cpp
Classes/MainMenuScene.cpp
Classes/NewScene.cpp
${PLATFORM_SPECIFIC_SRC}
)
set(GAME_HEADERS
Classes/AppDelegate.h
Classes/MainMenuScene.h
Classes/NewScene.h
${PLATFORM_SPECIFIC_HEADERS}
)
Then run CMake using "Build>Run CMake" menu. New files will apear in Project's hierarchy.
Upvotes: 3
Reputation: 575
Instead of QTCreator you can use CLion. Clion is cross-platform C++ IDE from JetBrains. This IDE have default support CMake. Setup the build system is very easy. I use this for development my game on the cocos2d-x engine - it's good tool.
Upvotes: 3