C++/CLI 或普通 C++关于图形/渲染

发布于 2024-09-13 11:05:54 字数 305 浏览 4 评论 0原文

我有 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浊酒尽余欢 2024-09-20 11:05:54

这实际上取决于您正在寻找什么。 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.

岁月打碎记忆 2024-09-20 11:05:54
  1. 一般来说,C++/CLI 是一种痛苦,恕我直言,不值得享受访问 .NET 库的好处。
  2. Visual C++ 是一个相当不错的编译器,可以生成标准的可执行文件。但是,它确实遵循标准 Windows 范例,即倾向于动态链接到库,如果在运行的系统上安装了正确的库,您可能会遇到问题。例如,对于标准 c 运行时来说,这可能是一个问题,并且某些应用程序确保它与其程序一起安装。如果您深入研究构建选项,您可以配置 Visual C++ 执行您想要的任何操作,例如静态链接 c 运行时 (http://msdn.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx)
  1. C++/CLI in general is a pain and imho, not worth the positives of having access to the .NET library.
  2. Visual C++ is a pretty decent compiler and will generate standard executables. However, it does follow the standard Windows paradigm of preferring to link to libraries dynamically and you may have issues if the correct libraries are installed on the running system. This could be an issue, say, for the standard c runtime, and some applications ensure that it is installed along with their program. If you dig into the build options, you can configure Visual C++ to do whatever you want, say link the c runtime statically (http://msdn.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文