Can I develop games for mobile platforms in C++?

James Bern
  • Can I develop games for mobile platforms in C++? James Bern

    I have a good grasp in C++ and C and have also experience developing AAA game using C++. Now, I'm shamelessly thinking to dive into mobile game development either in iOS or Android. Unfortunately, I don't know objective-C and java and neither have courage to learn it. So, As above mentioned reason, Is there any possibility to do mobile development in C++ without using any single statement of JAVA and Objective-C ?

  • Some objective C has to be written for iPhone apps. That being said, you can write a pretty thin layer of obj-c and then do all you game code in C or C++.

    On android look up the NDK. I don't have any experience with it, but it promises to be a native sdk so you should be able to write most things in C or C++.

    That being said, you're artificially limiting yourself with the language barrier. On iOS, if you want to do anything with the OS layer (like GameCenter, their social platform), or use any kind of middleware, you'd probably be faced with an objective C API.

    I can kind of understand the sentiment. C++ in particular is a huge language. But obj-c isn't a big. It's a bolt on to C (so the fundamentals should be familiar) with a few extra things added on top. It isn't nearly as complex or deep as C++.

  • I'm using cocos2d-x for a while, it's a game engine based on c++. (it actually a c++ port of cocos2d-iphone). using this engine you can easily run and test your codes on windows and then compile the same code for iphone/android export.

  • There is also Marmalade which allows you to use c++ to create mobile applications for a broad range of devices such as iPhone, Android, Win Mobile, Bada, and some more.

  • I've been writing a game for quite a while in c++ for Android. I have to touch the java code once every few weeks, but for the most part I modified one of the sample apps that comes with the NDK and have written c++ otherwise. I've had to do a bit of JNI work as well, which is never fun. However, I have many years of java experience, so having to write java or JNI doesn't particularly slow me down.

    My game runs just as well on my linux box as it does on my test devices. The linux version is pure C++ and the trouble I went through to make this work pays for itself every time I make an iterative change to my game.

    My project has 836 lines of java code, 331 lines of hideous jni C code and about 40k lines of C++ code.

Tags
c++ java android ios objective-c
Related questions and answers
  • When it comes to mobile game development on iOS and Android NDK, some developers write their own C++ containers, while others claim that STL is more than adequate for mobile game development (For example, the author of iPhone 3D Programming uses STL rather than Objective-C in his examples. His defense is that STL is no slower than Objective-C). Then there are also mobile developers who abandon C++ entirely and develop games entirely (or mostly) in the C language (C89/C90). What are the benefits and drawbacks of each approach?

  • Ive been reteaching myself opengl so I can make a game on android. However Ive been struggling with how to build objects and scenes in opengl using c/c++ and passing them through the jni...++ or java I just dont have much experience using the jni. Ive built some sample projects where I pass primitives like floats and perform operations on them on the native side and then passed them back but I cant figure out how to create a scene in opengl in c++ and then pass it to java. Ive been looking at writing everything using java but Im not sure if the java bindings make for some performance

  • I'm working on mobile platforms as Android, IOS... Many users of Moblox ask us a windows and an OS X version. There is no difficulties to provide these versions, because we are developing on OS X C++ code but we miss global scores and social network part (facebook, twitter). Is there any library to implement these functions on Desktops plaforms ? On mobile platforms, we have many SDK to provide theses functions as OpenFeint, ScoreLoop, Plus+. We have used cocoslive and uploaded scores with libcurl but it's very limited.

  • So being a primarily c/c++ developer, I've always thought that the only option for mobile game development for me was using iOS, which allows for c/c++ (and minimising objective C). I heard from a friend though, that android has a native development toolkit which allows for c++ code to work on android. Has anyone used this, and if so, how do you find it? I mean, will it "just work" like iOS, or are there more considerations that need to be taken care of due to the wide variety of android devices available?

  • I am a 2D Game Programmer.Some programming languages which I am good at are C,Java ,C#. I also know Actionscript 2.0,3.0 and some javascript. I'm interested in learning 3D Game programming. So far from the research I have accumulated by googling and reading different game development forums and articles. I've noticed that most programmers tend to prefer C++.Also in an online game programming teaching course I noticed they prefer to teach C++ and Visual C++ as the starting course. The reason I am asking this question since I would like to know the "strength" difference of C++, C# and Java

  • These days, I'm focusing on games development on the iOS. C++ is the lingua franca for games development but seriously, I prefer to code in C programming language, not in C++. So for iOS games development, are C and Objective-C sufficient for creating games?

  • I've read a couple posts on the subject and it sounds hairy. But I think people are talking about using STL containers for Objective-C objects. I'm using pure C++.

  • : Java would be excellent for android, but could I port it to a web app for chrome? (and its close to C#) Flash would work for a web app as I can just embed it into a html page (have done actionscript before, didn't care much for the IDE though), but would it also work on android? or I guess there is always C/C++ but haven't heard much about that, though I think it works for both (though C++ does...I have been developing for win7 mobile (XNA/silverlight and will continue to do so, love everything about it) but I wanted to branch a few of my more polished games to google app store online

  • Is it possible to load a texture using the NDK, but pass the result back to use in java. I have used the code in the link above and it appears to load the png correctly and generates a texture ID without an error (the id is 0 before the loading function is called and non-zero afterwards). Is it not allowed to mix opengl operations between C++ and java? Thanks for your help All the best, Ash

Data information