views:

282

answers:

7

Hi,

If you were writing a 2d graphics intensive application in C# (like animation software or a music sequencer with automated graphics control), which one would be a better choice for graphics library?

I'd like to develop a cross-platform application (at least portable on Windows 7, Linux), and I'd like to use only C#, avoiding mixing code in C++ (due also to interop issues).

I've already give a try to OpenTK, but it lacks of documentation, and it seems to be not very stable (using Mono it makes me sometimes crash the X server!!!)... And maybe I'm wrong, but I feel it is not a long supported library and it is going to die...

Is there a good and stable OpenGL wrapper for .NET/Mono?

I know there is a porting of Silverlight on Mono (Moonlight), but I read that has bad performance.

Thank you.

+1  A: 

There is irrlicht library but we decided to use OpenTK in our projects. Desipe some drawbacks in newest version (1.0) it works quite stable on Win7 and it works on Linux as well.

jethro
Irrlicht.Net is no longer developed or supported, there is a new project called Irrilicht .NET CP (http://sourceforge.net/projects/irrlichtnetcp/), but it seems to be inactive since 2 years! :-(...It seems OpenTK to be the best .NET choice. Isn't it?
Kill KRT
I can add that we use it for 2D map application as alternative to GDI and it performs quite well.
jethro
+1  A: 

You can use SDL.NET which is a .NET binding for the Simple DirectMedia Layer, a library used to create fast 2D games.

Another way could be GTK#, but I don't know about its graphics performance.

codymanix
I've rapidly tried SDL.NET, I was able to build the included example, but I got a fatal error launching it!
Kill KRT
Which error? Do you have graphics drivers propertly installed?
codymanix
"Got a SIGSEGV while executing native code. This usually indicatesa fatal error in the mono runtime or one of the native libraries used by your application.". My graphic drivers are correctly installed, Compiz is running without problem, and other 3D applications run correctly (on Ubuntu Studio 10.04 64bit).
Kill KRT
A: 

Right now, and for your purposes, I'd recommend MonoXNA

Alternatively, CSGL (OpenGL wrapper for .NET/Mono)

acron
MonoXNA site activities (e.g.: http://www.monoxna.org/forum) and TODO list make me think the project was good, but it is not still alive.Development of CsGL has been stopped since years. Randy Ridge (the author), has started new project called Tao. Unfortunately Tao project also seems to be dead. :-(
Kill KRT
What's wrong with dead projects? As it says on CsGL, it's probably gotten as good as it could be.
acron
You're right, but the problem is support: what if I found a new bug or I need to ask a question about something? I like to base my software on an alive project, mostly when I'm not really expert about the related topic.
Kill KRT
Fair enough. I think that's a bit too cautious but it's your project, I guess.
acron
A: 

It's been a while since I looked into cross platform gaming with .NET but when I was considering doing so I the Unity Game Development Tool looked quite attractive. I'm guessing that underneath they are using OpenGL and I don't know exactly where Unity stands in terms of whether they really provide their own Graphics API or whether it is more about providing a set of integrated tools for game development. If you haven't looked into it before though it is worth taking a peek.

jpierson
A: 

Since you are looking for something active and supported, how about Qt? It has .NET support. It is not something that I have personally used, but they have certainly been around a long time.

Larry Smithmier
A: 

I would only consider OpenGL if you really need 3D. Have you looked at Cairo? Also, as far as I know, System.Drawing works equally well on mono + gtk as it does on windows with .Net.

If you are keen you can try Moonlight.Desktop, the stable version works quite well with silverlight 2.0 controls, the beta supports silverlight 3.0 and some from 4.0, I've made a number of small apps that work like this in mono on linux and windows but there was a bit of manual hacking of build scripts to get my projects built.

Unless you have a reason not to do so, I would try to do a basic silverlight desktop app on windows and have a gtk# shell for linux/mono while all the time keeping a core (model + controller) assembly project building for both platforms.

IanNorton
Since my application needs complex graphic controls (and automated in real-time, such as: http://pouvoir-choisir.org/logiciel-libre/public/blender_screenshot.png or http://media.createdigitalmedia.net/cdmu/images//2007/06/thor.jpg), I think I need maximum performance, and I know C# is not the best for that (but I'd like avoid C++ and its "impure" OO implementation), thus I was thinking to use OpenGL (writing a custom GUI toolkit)... Ehm, I know it's a little tough!
Kill KRT
A: 

Csgl is perfectly stable...
...since it is no longer developed.

I really recommend the TAO Framework. It is cross-Platform (linux, mac os, windows) and still developed. It is quite huge and has alot of features.

Irrlicht and (mono-)Xna are designed for wirting games.

Floste