PDA

View Full Version : C#will become public,is it fitted to opengl



guoxusheng
09-13-2002, 05:30 PM
i know MicroSoft,so i have to learn to program with C#,but i wonder whether the language is suit to opengl ? how about its performance.

V-man
09-13-2002, 07:07 PM
What the hell does "the language is suit to opengl" is suppose to mean?
Ask this in an MS forum. It is a known fact that you must use DX to get the best performance out of C#.


V-man

[This message has been edited by V-man (edited 09-13-2002).]

Nakoruru
09-13-2002, 08:31 PM
Why would that automatically be true? It may be easier to use DX with C# (because C# supports COM objects natively) but I do not think performance would be any different more different than with C/C++ once you created a Type Library for OpenGL and then used it with C# (A type library is a desciption of an interface, you can make one for OpenGL32.dll). From what I remember, you could make a type library for opengl with no trouble and it probably has already been done for use with Visual Basic.

OpenGL performance is mostly about batching primitives and avoiding redundant state changes. That is possible in any language. Unless you are CPU limited, the choice of languages does not effect your graphics performance.

[This message has been edited by Nakoruru (edited 09-13-2002).]

V-man
09-14-2002, 10:10 AM
I guess you didn't get the joke.

V-man

Nakoruru
09-14-2002, 12:57 PM
Joke? Oh well, I'm not the first or last person on the internet to miss a joke. You know, the 20th anniversary of the :-) joke marker is coming up this month (the 20th I believe), maybe you should learn to use it ^_^

Fredz
09-14-2002, 08:58 PM
Now that's what I call irony http://www.opengl.org/discussion_boards/ubb/smile.gif

Pedro
09-15-2002, 04:48 AM
I'm also interesed in C# and OpenGL.

I have a lot of win32/C++ code that I would like to package into a .NET component (or whatever it's called), so that it can be used by .NET C#, VB or C++ aplications (through an application specific interface).

Has anybody tried to do this? Basically what I'd like to know is: if its possible to create a managed .NET C++ application that can create a win32 window with an OpenGL rendering context.

Furthermore, it should somehow be possible to use this as a child window in a more complex GUI built used VB or C# tools.

I haven't looked enought into .NET to know if this is possible. Perhaps somebody here has some experience with it and could give me a few hints.

Nakoruru
09-16-2002, 04:39 AM
Pedro,

I think that you would have to use OpenGL as an unsafe component because it uses pointers and I do not think it would play nice with the garbage collector.

However, If you really need safety, I think you could create a safe wrapper around OpenGL. I'm not really sure if its possible, because your 'safe' module would only be as safe as the code you write to wrap opengl.

I'm sure that DirectX needs wrapping as well, but I'm sure that Microsoft has already done that for you.

sc_sc0
09-16-2002, 07:08 AM
Yes C# is perfectly suitable for OpenGL.
Only problem I currently encounter is calling function pointer for extension, but that' likely to fixed by next major release. It's not big problem.

Pedro
09-16-2002, 09:53 AM
Thanx everyone.
I'll give it a try then ...

--
Pedro