PDA

View Full Version : Does C# support OpenGL1.4??



may_hawk
04-29-2003, 02:18 AM
1> I am learning C# and OpenGl, so

I don't want to learn C++ again.

2> Which developing_softs support OpenGL_1.4 for developers to use?

Please help me, thanks a lot.

mikael_aronsson
04-29-2003, 03:30 AM
Hi !
C# does not have any support for OpenGL, with that said it's pretty easy to use OpenGL from C# and you can use OpenGL 1.4 features to, but there is no builtin support for it.

Mikael

Rog
04-29-2003, 03:30 AM
C# has no native support for the OpenGL API. If you want to use OpenGL from C#, you need to write your own interop wrappers or use one of the various samples posted on various sites (Google it).

Because of the interop overhead, opengl apps from C# are noticeably slower than C/C++ equivalents, even on pretty simple scenes.

I can highly recommend learning both C# *and* OpenGL, but unfortunatley they don't go too well together http://www.opengl.org/discussion_boards/ubb/frown.gif

If you don't want to get too involved in the C/C++ in Windows side of things, then GLUT is probably your best route to get some OpenGL under your belt.

may_hawk
04-30-2003, 07:11 PM
Originally posted by Rog:
C# has no native support for the OpenGL API. If you want to use OpenGL from C#, you need to write your own interop wrappers or use one of the various samples posted on various sites (Google it).

Because of the interop overhead, opengl apps from C# are noticeably slower than C/C++ equivalents, even on pretty simple scenes.

I can highly recommend learning both C# *and* OpenGL, but unfortunatley they don't go too well together http://www.opengl.org/discussion_boards/ubb/frown.gif

If you don't want to get too involved in the C/C++ in Windows side of things, then GLUT is probably your best route to get some OpenGL under your belt.

http://www.opengl.org/discussion_boards/ubb/smile.gif
It't very king of you helping me. Now I know
that Apps from C# run slower a bit, but I appreciate C# and Java. I think I should knoe about "The GLUT".

Ridge
05-04-2003, 07:19 AM
Originally posted by may_hawk:
http://www.opengl.org/discussion_boards/ubb/smile.gif
It't very king of you helping me. Now I know
that Apps from C# run slower a bit, but I appreciate C# and Java. I think I should knoe about "The GLUT".

OpenGL works fine in the .NET environment. You need some form of wrapper, I suggest you look at CsGL and Tao.OpenGl:
http://csgl.sourceforge.net

http://www.randyridge.com/Tao

Tao.OpenGl is the 'newer' version of CsGL, while only supporting OpenGl 1.1, it has additional benefits of being CLS-compliant (so you can use c#, vb.net, etc), GLUT support, it's cross-runtime and cross-platform (MS's and the mono runtime on windows, mono on *nix/*bsd), and API documentation. CsGL, while it's the older codebase supports OpenGL 1.4, and only has support for Windows. I'd suggest Tao, it won't be log before they're back up to supporting OpenGL 1.4.

As for performance, from my tests the P/Invoke overhead is fairly minimal, most apps will run 1-5% slower than c/c++, the largest performance penalty you'll see is in relation to array performance, particularly multidimensional arrays...

--
Ridge