O
O
Ockonal2012-08-26 12:56:35
Objective-C
Ockonal, 2012-08-26 12:56:35

C++-> Mobile platforms

Hello. We write a 2D engine for games. Everything works fine, but it only works for pc platform (lin/mac/win). Having written a couple of wrappers and wrappers, I achieved porting to android. Now I would like to run everything under i-devices. Is it possible to transfer everything without rewriting all the code to objective c? In other words: is it possible to compile a C++ application for iphone or ipad, for example.

Thank you.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
N
northicewind, 2012-08-27
@Ockonal

There won't be any problems. Apple LLVM Compiler (included with xcode) easily compiles C++ code. He even knows how to do something from C++11. On Obj-C, you will have to make an entry point for the application and, most likely, work with sound. Adjacent parts will need to be formatted as Obj-C++ (.mm extension). If there are difficulties with porting the code, look at cocos2d-x, but not the release, but the version from the repository (they cleaned up the code and changed the directory structure).
In general, if your engine was written from the very beginning as cross-platform and draws through ogl (ogles), then everything will be fine. Good luck.

B
bobermaniac, 2012-08-26
@bobermaniac

Try to use Objective C++
True, you will have problems. Most likely a lot of problems. But everything can work.

C
corristo, 2012-08-26
@corristo

Yes, everything will be fine, just a few modules in Objective-C ++ for the interaction of your engine and iOS.

J
jintwo, 2012-08-26
@jintwo

It is possible, but one way or another, platform-dependent things (drawing all this stuff through coregraphics, for example) will have to be implemented in C / Obj-C.

Y
YoungSkipper, 2012-08-26
@YoungSkipper

What do you use for graphics? If opengl - then there will be no problems, make a branch on open gl es (1.1 / 2.0 - depends on your needs) and that's it. C++ code compiles with a bang and works.

D
DarthRamone, 2012-08-26
@DarthRamone

Hm. I may not understand something, so please do not throw stones. But after all, android does not natively support cpp?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question