C++/CLI 或普通 C++关于图形/渲染
我有 .NET 背景,将进入使用 OpenGL/DirectX 进行渲染/图形领域。为此,我选择 C++ 与这些渲染框架进行交互。
据我了解,Visual C++ 允许对 CLI 的本机支持,CLI 是 C++ 的扩展,允许应用程序从托管运行时中受益。您是否建议我花时间习惯 C++/CLI,还是应该坚持使用纯 C++?
另外,当使用 Visual C++ IDE 时,我对编译器有何期望?标准 C++ 编译代码是否是能够在正常 C++ 可执行文件可以运行的任何地方运行的标准可执行文件?我听说 VC++ 编译器有其自身的问题。
I come from a .NET background and will be going into the field of rendering / graphics using OpenGL/DirectX. For this purpose C++ will be my language of choice to interact with these rendering frameworks.
As I understand it Visual C++ allows native support for CLI which is an extension to C++ that allows the application to benefit from the managed runtime. Would you recommend spending time getting accustomed with C++/CLI or should I stick to plain C++?
Also, when using the Visual C++ IDE what can I expect from the compiler? Will standard C++ compiled code be standard executables capable of running anywhere that a normal C++ executable would run? I've heard that the compiler for VC++ comes with issues of its own.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这实际上取决于您正在寻找什么。 C++/CLI 具有其他 .NET 语言很少有的优点(对混合模式的强大支持就是其中之一),但它本质上仍然是一种 .NET 范例。您要深入研究它的唯一原因是您是否想要 .NET 提供的功能。如果您的主要需求是全屏类型应用程序,那么学习 .NET 扩展不太可能为您带来太多好处,而学习功能更强大的 C++ 扩展库之一也不会为您带来好处,并且仅 C++ 选项将保留交叉平台兼容性。
至于编译器,近年来 Visual Studio 的 C++ 编译有了显着的改进。编译后的可执行文件需要在目标系统上安装正确的运行时,但这并不是一个特别繁重的要求。
It really depends on what you're looking for. C++/CLI has advantages that few of the other .NET languages share (strong support for mixed mode being one of them), but it's still a .NET paradigm at heart. The only reason you're going to delve into it is if you want what .NET offers. If your primary need is for full-screen type applications, it's unlikely that learning the .NET extensions will get you much that learning one of the more capable C++ extension libraries wouldn't get you, and the C++-only option would retain cross-platform compatibility.
As to the compiler, recent years have seen dramatic improvements in Visual Studio's C++ compilation. The compiled executables require the correct runtime to be installed on the target system, but that is not a particularly onerous requirement.