随着移动平台软硬件的发展,越来越多游戏可以用于移动平台上。比如Unreal等大牌游戏引擎,也有了移动版本。没准过不了多久,CryEngine也会出现在手机上。
With the development of mobile platforms’ software and hardware, more and more games are available for mobile platforms. And other great game engine, such as Unreal, also has mobile versions. Probably it won’t take a long time to see a mobile CryEngine.
除了软硬件本身,阻碍开发的另一个因素就是开发语言。几乎所有现有桌面平台的游戏引擎都是用C/C++完成的,如果手机平台上没有C/C++的支持,那么重写引擎的代价会非常的大。下面就来看看现在流行的几大移动平台对纯C/C++的支持情况。
Besides hardware and software, another problem is the language used in development. Almost all existing game engines on desktop platform are written in C/C++. If a mobile platform has no C/C++ support, the cost of rewriting the engine will be very high. Now lets have a look at the situation of pure C/C++ support of major mobile platforms.
Symbian
作为老牌移动系统,Symbian平台对C++的支持一直不错。官方的Symbian SDK就包含Symbian C++,STL和Boost没啥问题。
As a tradition style mobile system, Symbian platform supports C++ well. The official Symbian SDK includes Symbian C++. The STL and Boost works well too.
iOS
iOS跟着iPhone和iPad被炒得热火朝天,但Apple提供的SDK官方只支持Objective-C。鉴于iOS SDK用的也是gcc tool chain,所以实际上也可以直接用gcc来编译C/C++代码,也有人这么做了。据说只要经过申请,就能获得Apple提供的C++ SDK。
iOS are hot along with iPhone and iPad. But the SDK provides by Apple officially supports Objective-C only. Since iOS SDK uses gcc tool chain, in fact the gcc can be used to compile C/C++ code directly. And someone has already done like that. It’s said that you can get a C++ SDK from Apple after applying from them.
另一种选择是使用第三方SDK,比如DragonFire SDK。它可以在Windows下用纯C/C++开发iOS程序,摆脱了对Mac的要求。
Another option is to use a third-party SDK, such as DragonFire SDK. It can help you to develop iOS apps on Windows with pure C/C++. No Mac any more.
Android
Android’s “native language” is Java. I have a post “Pure C/C++ development in Android” few days ago talking about the method of utilize NDK to develop pure C/C++ apps. Full STL, RTTI, Boost and many libraries can be used without third-party modified Crystax NDK.
Windows Phone 7
虽然上一代Windows Mobile对C++的支持不错,但现在的Windows Phone 7(WP7)官方只提供了C#和Sliverlight来进行开发的方法,不支持C++原生代码。目前也还没看到有松动的迹象,很可惜。Onan Games倒是提供了一个中间件,可以在浏览器、WP7和Flash里执行C、C++和Objective-C源代码。我估计使用了动态编译之类的方法,仍然不是原生的,效率最多也就Java虚拟机那样而已。
While the previous generation, Windows Mobile, supports C++ well, but the Windows Phone 7 (WP7) officially provides only C# and Sliverlight for development. It’s a pity that it doesn’t support native C++ code yet. Onan Games provides a middleware than can execute C, C++ and Objective-C source code in web browsers, WP7 and Flash. I think it uses some dynamic compilation methods, still not a native solution. I even don’t know if it reaches the speed of a Java virtual machine as well.
MeeGo
MeeGo被Intel和Nokia捣鼓了那么多年,仍没什么起色。MeeGo的内核是Linux,SDK原生的语言就是C/C++,所以在这方面也没什么问题。
Intel and Nokia are working on MeeGo for many years. MeeGo’s kernel is Linux, its SDK‘s native language is C/C++. So no problem here.
总结
Conclusion
总的来说,目前几个移动平台都可以顺利地用纯C/C++进行开发,就等WP7了。
Nearly all major mobile platforms can be successfully using pure C/C++ for development currently. Waiting for WP7 to catch up with them.
Comments