English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Is there a way to convert glut.dll lybrary for visual C++ so that it can be used in C#?

2007-03-09 07:26:01 · 4 answers · asked by Specter 1 in Computers & Internet Programming & Design

4 answers

Conversion isn't what you're looking for here, but rather "wrapping". The API calls have to be wrapped in C# so it's convenient to use. You'll find that mainstream OpenGL & .NET integration hasn't been a topic of great interest in several years - most hobbyists opt for Direct3D in .NET and development shops have their own methods for tying the two together.

That having been said, the largest project is/was http://csgl.sourceforge.net/ I've used this in the past to a very limited degree. GLUT is fully supported.

A much simpler and smaller project is http://www.colinfahey.com/csharp_wrapper_opengl_windows/csharp_wrapper_for_opengl.html - all GLU functions are supported.

Both of these projects work well, but active development has ceased. Hope that helps - good luck.

2007-03-09 07:45:57 · answer #1 · answered by Zack 1 · 1 0

Well, you can get ahold of the glut source and turn on the CLR flag in the C++ compiler and recompile it into a managed assembly, but that's going to be a lot of work.

Or you can use P/Invoke to call the glut methods.

I know there are managed OpenGL libraries available for C#.

But actually the best is to use managed direct X, as it will allow you to do the same things. Since you're using C#, you're stuck with Windows, so you don't need the portability that the OpenGL platform provides.

2007-03-09 16:00:48 · answer #2 · answered by Pfo 7 · 0 0

yes.

dunno if it's a good idea or not (due to interop), but you could use the type-library import tool (tlbimp.exe or something like that, it comes with .Net) to create an assembly you can use as a reference.

it will spit out a new dll that you can link to in your project, with no need to do DllImports etc.

2007-03-09 16:35:08 · answer #3 · answered by fixedinseattle 4 · 0 0

c# really isnt a good platform for 3d graphics programming because you surrender a lot of power for greater simplicity. i suspect that you may have trouble compiling the c++ glut header files in c#. and as far as the .dll goes it sounds like it may be a proprietary .dll for vc++. however i dont really use vc++ for my purposes so i could be proven wrong.

2007-03-09 15:45:55 · answer #4 · answered by Anonymous · 0 1

fedest.com, questions and answers