OpenGL的工作时,在C#中的C ++有哪些优势 [英] What advantages exist in C++ over C# when working with OpenGL

查看:207
本文介绍了OpenGL的工作时,在C#中的C ++有哪些优势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始让感兴趣的学习在OpenGL中,我试图找出什么是最好的方向去尽可能在学习过程中要使用的语言。我已经很熟悉了C#,从我读过,我可以利用API涛从C#代码使用OpenGL接口。然而,它也似乎我从什么我读,那些谁是真正的专业OpenGL的开发商是C ++程序员。

I am starting to get interested learning in OpenGL and I am trying to figure out what the best direction to go as far as which language to use in the learning process. I am already very familiar with C# and from what I have read, I can utilize the Tao API to interface with OpenGL from C# code. However, it also seems to me from what I'm reading that those who are really professional OpenGL developers are C++ programmers.

我很好奇,可能有什么优点C ++了与在OpenGL 3D图形工作时,C#。因为我对这一切完全纽比任何投入将是巨大的。

I'm curious what advantages C++ might have over C# when working with 3D graphics in OpenGL. Any input would be great as I'm a complete newby at all this.

推荐答案

通过C#使用OpenGL的有一定难度。

Using OpenGL via C# has some difficulties.


  1. 获得一个向上的最新SDK。陶一直没有更新自2008年OpenTK一直没有自2010年以来的OpenGL月稳定版本已的两个的版本发行,因为2010年6月这是一个很大的功能,你根本无法从C#访问。我不知道OpenTK的Nightlies版如何稳定是的,但我一般不信任Nightlies版。用C / C ++,你可以得到你想要加载任何函数指针。在C#中,你只能用你的工具包提供了什么。

  1. Getting an up-to-date SDK. Tao hasn't been updated since 2008. OpenTK hasn't had a stable release since June of 2010. OpenGL has had two version releases since June 2010. That's a lot of functionality you simply cannot access from C#. I don't know how stable OpenTK's nightlies are, but I generally don't trust nightlies. With C/C++, you can get whatever function pointers you want to load. With C#, you can only use what your toolkit provides.

与缓冲区对象处理可以在C#中相当痛苦。是的,有办法上传均匀值数组缓冲对象。但是建立交错顶点数据,其中不同的组分具有不同的类型,是在C#困难得多。在C和C ++,你要直接访问内存。所以很容易有花车后面的字节4向量的3矢量,全部保存在每个顶点16个字节。这是在C#中比较困难。

Dealing with buffer objects can be quite painful in C#. Yes, there are ways to upload arrays of uniform values to buffer objects. But building interleaved vertex data, where different components have different types, is much more difficult in C#. In C and C++, you have direct access to memory. So it's easy to have a 3-vector of floats followed by a 4-vector of bytes, all stored in 16 bytes per vertex. It's rather more difficult in C#.

图形代码通常是代码的更高性能的关键领域之一。通常你会想要一个C ++,如果你喜欢做一个游戏的高性能渲染应用程序得到控制。因此,许多的C#的很好的功能对着干这里。

Graphics code is generally one of the more performance-critical areas of code. You will generally want the control that C++ affords if you're making a high-performance rendering application like a game. So many of C#'s nice features work against it here.

唯一真正好处,使用C#提供的是.. 。这是C#。为了一个你认为你的优势,那么这是一个优势的程度。

The only real advantage that using C# provides is that... it's C#. To the degree that you feel that advantages you, then it is an advantage.

这篇关于OpenGL的工作时,在C#中的C ++有哪些优势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆