What's the best alternative to C++ for real-ti

2019-03-10 16:22发布

C++ just sucks too much of my time by making me micro-manage my own memory, making me type far too much (hello std::vector<Thingy>::const_iterator it = lotsOfThingys.begin()), and boring me with long compile times. What's the single best alternative for serious real-time graphics programming? Garbage collection is a must (as is the ability to avoid its use when necessary), and speed must be competitive with C++. A reasonable story for accessing C libs is also a must.

(Full disclosure: I have my own answer to this, but I'm interested to see what others have found to be good alternatives to C++ for real-time graphics work.)

Edit: Thanks everyone for the thoughtful replies. Given that there's really no "right" answer to this question I won't be selecting any particular answer. Besides I'd just pick the language I happen to like as a C++ alternative, which wouldn't really be fair.

30条回答
Viruses.
2楼-- · 2019-03-10 17:15

If your target is a PC, I think you can try C#, or embed Lua in your C++ app and run scripts for 'high-level' stuff. However if your target is a console, you must manage your own memory!

查看更多
Bombasti
3楼-- · 2019-03-10 17:16

There are no true alternatives for big AAA titles, especially on the consoles. For smaller titles C# should do.

查看更多
仙女界的扛把子
4楼-- · 2019-03-10 17:20

Have a look to Delphi/Pascal Object and some exemples : http://www.delphigamer.com or http://glscene.cjb.net/

查看更多
smile是对你的礼貌
5楼-- · 2019-03-10 17:21

Sometimes, looking outside the beaten path you can find a real gem. You might want to consider PureBasic (Don't let the name mislead you). Here's some details:

PureBasic Features

  • Machine Code (Assembly) executables (FASM)
    • In-line Assembly support
    • No run-times needed (no DLLs needed,etc.) 1 executable file
    • Tiny executables (as small or smaller/as fast or faster than C++ w/out the runtime)
    • You can write DLLs
    • Multi-thread support
    • Full OS API support
  • Multi-platform support
    • Windows 95-2003
    • Linux
    • Mac-OS X
    • Amiga
  • 2D & 3D game development
    • DirectX
    • OGRE
  • Generous Licensing
    • Inexpensive (79 Euros or about $112)
    • Life-time license (all future updates & versions included)
    • One price for all platforms
  • External Library support
    • 3rd party DLLs
    • User Libraries
  • On-line Support
    • Responsive development team led by it's creator
    • On-line forum
      • One place for answers (don’t have to go all over the net)
      • Huge amount of sample code (try code out while in IE with IEtool)
      • Fast replies to questions
  • Bonus learning (alternative to learning C++)
    • API
    • Structures
    • Interfaces
    • Pointers

Visit the online forum to get a better idea of PureBasic (http://www.purebasic.fr/english/index.php) or the main site: www.purebasic.com

查看更多
叛逆
6楼-- · 2019-03-10 17:21

Java and LWJGL (OpenGL wrapper) has worked well for me. If you're looking for more of a scene graph type library like Orge have a look at jMonkeyEngine which we used to create a google earth type application (see www.skapeworld.com). If you're sensible with object creation the garbage collection is a non issue.

查看更多
Evening l夕情丶
7楼-- · 2019-03-10 17:22

Perhaps a hybrid approach. Python and C++ make a good combination (see, for example, PyGame).

查看更多
登录 后发表回答