Sign in to follow this  
white skies

C# + openGL

Recommended Posts

Quote:
Original post by white skies
Hi!
Can I use the regular openGL dlls with C#? [smile]


Yes.

Since they are not .net clr managed stuff you will need to use pinvoke to access them. The web site pinvoke.net has a collection of some of the methods. Google can find more.

Either that or you can hunt for a wrapper that somebody else has written.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
just a note though: using PInvoke may be what people suggest first but having the PInvoke mechanism kick in for every function call to opengl might be a little expensive (in practice it's not so bad. PInvoking every function is how many wrappers out there are doing it). in managed directx microsoft is trying to minimize the PInvoke calls as much as possible. i don't know if such a library exists for c# and opengl or if tao.gl minimizes PInvoke calls. that said, there are many successfull and performant apps out there using tao.gl or other c# wrappers.. so maybe you should just forget what i said. i just wanted to point out that there's two ways of exposing opengl: a 1 to 1 wrapper or something that tries to minimize calls to the unmanaged dlls; you'd prefer the latter.. but maybe only the first one is available.

cheers,
simon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this