What are the advantages in C ++ over C # when working with OpenGL

I am becoming interested in learning in OpenGL, and I'm trying to figure out which is the best direction for which language to use in the learning process. I am already very familiar with C # and from what I read, I can use the Tao API to interact with OpenGL with C # code. However, it also seems to me that those who are truly professional OpenGL developers are C ++ programmers.

I'm curious about the benefits C ++ can have over C # when working with 3D graphics in OpenGL. Any input would be great, as I am completely new to this.

+7
source share
2 answers

Using OpenGL through C # has some difficulties.

  • Getting the updated SDK. Tao has not been updated since 2008. OpenTK has not had a stable release since June 2010. OpenGL has had two version releases since June 2010. This is great functionality with which you simply cannot access from C #. I don’t know how stable OpenTK night carriages are, but I usually don’t trust night carriages. With C / C ++, you can get any pointers to the objects you want to load. With C #, you can only use what your toolkit provides.

  • Working with buffer objects can be quite painful in C #. Yes, there are ways to load arrays of single values ​​into buffer objects. But constructing alternating vertex data where different components have different types is much more complicated in C #. In C and C ++, you have direct memory access. Thus, it is easy to have a 3-vector floating point followed by a 4-vector bytes, all of them are stored in 16 bytes per vertex. This is harder in C #.

  • Graphic code is usually one of the most important for critical areas of the code. You usually need a control that C ++ gives if you are building a high-performance rendering application like a game. So many C # nice features work against this here.

The only real advantage is that using C # provides ... C #. To the extent that you feel that you are an advantage, it is an advantage.

+5
source

The advantage that is most directly related to you is the predominance of textbooks using C code that readily accepts C ++ compilers.

The most widely applicable advantage is portability: C # is Microsoft's child, and support for this language on platforms other than Microsoft is sketchy at best. Wikipedia currently claims that the latest ISO standard for C # is 2.0, while Microsoft has released 4.0 and is already developing 5.0!

+3
source

All Articles