C++ Android 中的 Java 对比
我对开始游戏开发很感兴趣。我目前用 C++ 做了一些 openGL,但现在我正在寻找提供 Android 的选项,并且我找到了使用本机代码 (C++) 开发游戏的人以及使用 Java 的其他人......
所以我真的不知道知道哪个是主要区别。我读到很多人有使用 C++ 的经验,并且更喜欢这个,而不必使用 java 学习新东西......但我不认为这是主要原因。
使用 C++ 或 Java 开发游戏的主要区别是什么?性能?可扩展性?可能性?
另外,您建议使用OpenGL开始游戏开发吗?
I'm interesting in start a game development. I currently did some openGL in C++, but now I'm looking for the options that offers Android, and I have found people who developes his games using Native code (C++) and others that use Java...
So I don't really know which is the main difference. I read that many people has experience using C++ and prefers this one to don't have to learn new things using java... but I don't think this is the main reason.
What are the main differences developing a game using C++ or Java? Perfomance? Scalability? Posibilities?
Also, do you recommend to start the game development using OpenGL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我建议使用您更熟悉的语言。游戏从来都不是一个小项目,而且由于您是这个过程的新手(根据这个问题判断),您可能不会担心任何性能差异或类似的问题。
要回答您的问题:
性能
请参阅C++与 Java 性能、Android:Java、C 还是 C++? 等。
可能性
没有什么继承是 C++ 可以做而 Java 不能做的,或者当涉及到您的目标时反之亦然。
可扩展性
不确定您对这个有什么要求。
I would suggest using whichever language you are more comfortable with. A game is never a small project, and since you are new to the process (judging by this question) you will probably not be concerned with any performance differences or anything like that.
To answer your questions:
Performance
see C++ vs Java Performance, Android: Java, C or C++?, etc.
Possibilities
There is nothing inherit that C++ can do and Java can't, or vice versa when it comes to your goal.
Scalability
Not sure what you are asking with this one.
C++ 可以比 Java 表现得更好(不要相信反对者,做你自己的基准测试),但 Android 上对 Java 有更多支持。最终,这取决于您的应用程序的强度以及将消耗多少电池。如果它非常密集,请选择 C++,因为您可以用更少的资源做更多的事情。如果没关系,那就用Java吧。
C++ can perform better than Java (don't believe the naysayers, do your own benchmarks), but there is more support for Java on Android. In the end it depends on how intensive your app is going to be and how much battery it is going to drain. If it is extremely intensive, go with C++ because you can do more with less. If it doesn't matter, then go with Java.
最后,如果你使用c++,你将需要学习所有用于android开发的框架,如果你使用java,你将学习java,而openGL在所有语言中都是相同的,所以如果你是,就选择c++一名 C++ 开发人员
你不应该从OpenGL开始,不是说你不能,但我会告诉你一些像SFML这样的东西,女巫会教你很多关于图形编程的知识,然后你可以转向OpenGL
at the end it doesn't matter sense if you use c++ you will need to learn all those frameworks used for android development, if you use java you will learn java and openGL is the same in all languages so just go with c++ if you are a c++ developer
you should not start with OpenGL not that you can't but I would sagest something like SFML witch will teach you a lot about graphics programming then you can move to OpenGL