Can you write mobile games in C++?

Started by
17 comments, last by Crichton333 9 years, 1 month ago

Hello! I am learning C++ and was curious if I could write iOS and Android games with the language. I heard that in Visual Studio 2015 it would allow for mobile game development with C++. If this is true what else would I need? Would I just need the Android NDK for Android or something else? What is my cheapest option if this is even possible? Would I need something other than Visual Studio? Thank you for your time! smile.png

Advertisement

Yes. Here is a game framework called [Cocos2d-x](http://cocos2d-x.org/). You can write your game in c++ with it, then complies your game into iOS or Android app;

Yes. Here is a game framework called [Cocos2d-x](http://cocos2d-x.org/). You can write your game in c++ with it, then complies your game into iOS or Android app;

Thanks for the response! I will definitely check that out. Can you write the game entirely in C++ or does it require some Java/Objective-C?

Android will need at least a small bit of Java, and iOS a small bit of ObjC or Swift.
Yes but I wouldn't advice people to program with C++ on Android if you plan to publish this.
There are just so many different phones to support it gets a pain really fast just for a single developer and expensive for studios and teams.

Just have a look at the game "Eye Guy" in Google Play Store, the maker wrote an article here on GameDev.net (right now on the front page).

Apple doesn't has this problem.

To summarize: Yes you can use C++ (Of course!)

Thank you all for your responses! I will definitely check out Cocos2d. If anyone else knows of a different better tool please let me know!

Yes but I wouldn't advice people to program with C++ on Android if you plan to publish this.
There are just so many different phones to support it gets a pain really fast just for a single developer and expensive for studios and teams.

Just have a look at the game "Eye Guy" in Google Play Store, the maker wrote an article here on GameDev.net (right now on the front page).

Apple doesn't has this problem.

To summarize: Yes you can use C++ (Of course!)

What difference does it make what language he writes it in? You STILL have to use different tools for each platform. And what "problem" is it that android has that iPhone doesn't?

If a developer is comfortable using C++ and can get familiar using the NDK then C++ is totally fine, infact its preferable in certain OpenGL situations. I've also noticed a number of C++ cropping up for Android including a version of Qt for it. I my self use Android and have written one app for it using the "native" google java sdk. Love Android, but I really hate that google sdk/eclipse packge, that is the single more wonky lump of software I've ever had the displeasure of working with. Would much prefer a tighter one, and noticed several possibilities since I wrote that one app.


What difference does it make what language he writes it in? You STILL have to use different tools for each platform. And what "problem" is it that android has that iPhone doesn't?

At least to get to the point of running at all, it makes all the difference. You have 1 basic model of iPhone (different storage capacities though) through most of the life of iOS devices -- and a couple different models/product lines in recent years. But all of a given vintage have roughly the same hardware. On android, you have hundreds of different OEMs each with several models of handhelds, tablets, and some set-top-boxes thrown in for good measure. Specs are all over the place, and there's at least three major instruction sets in active use (arm, x86, mips), each with several different generational/vendor implementations.

If you're going to optimize, then you have to start treating all the iOS devices as the distinct targets that they are, but just to get up and running they're (almost) effectively one platform -- even with the dozen or so relevent iDevices, that's still worlds better than the ~hundred relevant android ones.

throw table_exception("(? ???)? ? ???");

Not to mention that Android’s NDK’s (which you must use if you use C++) debugging tools are severely lacking.

With Android you get the choice of having full debugger support, but you have to use Java, or you can use C++, but with virtually no debugging support.

It’s basically like a guy giving you 2 choices: A: he knees you in the groin or B: you groin him in the knee.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Using the Android NDK seems a bit "off". Not sure how to really explain it. It might just be all the hoops you have to jump through to get a C++ app up and running on Android. Not to say you can't or shouldn't use C++ if you so choose to do so but using Java for Android is much easier in my opinion (you don't have to use the absolutely insane factory/abstraction stuff you see in commercial Java development) . For iOS it isn't such a big deal since you can just do Obj-C++ and let Xcode do everything for you.

If you are planning on doing anything like ads, game center tracking, etc you will have to write Obj-C/Java. System stuff will still need to be done with the target language.

This topic is closed to new replies.

Advertisement