Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Need guidance on which gfx lib to use for .NET


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 EFileTahi-A   Members   -  Reputation: 130

Like
0Likes
Like

Posted 18 March 2012 - 11:16 AM

GDI+ is clearly not fast enough for me. I really don't understand why .NET has such library capable of doing so much with such low performance. Having said that, I now seek a new graphics library for my project which is a tiled 2D game, being developed in C#.

SDL .NET
I've browsed the web and I've found some interesting things like the SDL lib. There is SDL C# wrapper for .NET which seems rather nice. After I tried it I realize it would not compile on x64 architectures. So I went to their forum just to look at its scary inactivity. There is one post over there that actually describes my problem, unfortunately it has not been answered, not even after almost an year. SDL C# last update was in 21 November 2010, so I can sadly assume it is pretty dead. Moving on.

OpenGL
I want to do simple things like drawing images and text, something that is quite hard to achieve with OpenGL's .NET wrappers I've come across. I really don't need that much performance just something simple to use, for the very own simple things I mentioned above. SDL C# was very easy to work with, too bad it is gone...

DirectX
I still didn't get it. Managed Direct X was discontinued, does this means June's DirectX SDK does not support it? Does not support it but still includes their libraries? I'm using some libraries that came with it. Are those managed? They are inside a folder named: DirectX for Managed Code. The most recent library seems to have the version 1.0.2911.0 last updated on 31-03-2006. Can someone please clarify if these are the libs that were discontinued? I really don't want to use stuff at the edge of dying.

Anyway, I just need a simple solution for drawing 2D graphics inside multiple .NET controls, namely panels and forms. I really don't care if it does not support advanced 3D features or 3D at all, all I need is a solid 2D gfx lib with good support and easy to work with. I wouldn't mind at all using DirectX since I'm a bit familiar with it. But a solution like SDL would be the key. XNA seems to be quite different from those-libs-I'm-not-sure-if-they-are-managed. So I'm avoiding it.

Thank you very much for any possible help in this issue. I'm a developer eager to develop in my not-so-available-spare-time and I have this project I want to share with the rest of the world, but the beginning seems to be challenging already.


"Sometimes you may think you're alone but that's not true, where ever you go, Death is always near and always watching you." By me January 2007

Sponsor:

#2 Postie   Members   -  Reputation: 1087

Like
0Likes
Like

Posted 18 March 2012 - 06:24 PM

Managed DirectX (MDX) was discontinued quite some time ago. The replacement for it is XNA.

If you're more into the low-level side of things, SlimDX is a low-level managed wrapper for DirectX, which I've been using for the last 15 months and can highly recommend. SlimDX can be integrated with WPF controls apparently, but I haven't done it myself, so I'm not sure how effective that might be for you.
Currently working on an open world survival RPG - For info check out my Development blog: ByteWrangler

#3 Memories are Better   Prime Members   -  Reputation: 769

Like
0Likes
Like

Posted 18 March 2012 - 07:48 PM

I'm a developer eager to develop in my not-so-available-spare-time


I would highly recommend XNA, it is very easy to learn and use, you can make both 2D and 3D games with it too and it will take far less time than say DirectX / OpenGL

#4 laztrezort   Members   -  Reputation: 968

Like
0Likes
Like

Posted 18 March 2012 - 08:20 PM

I'm not sure what you mean by this:

XNA seems to be quite different from those-libs-I'm-not-sure-if-they-are-managed. So I'm avoiding it.


But it seems to me you probably want to look into XNA. XNA is one of the simpler options, has a lot of support and on line information, can be easily embedded in a Winforms application, and is similar to DirectX since it's built on it.

The biggest thing OpenGL (and their ilk, such as SDL) wrappers have that XNA doesn't have is a semblance of portability (ignoring the usual OpenGL to DirectX comparisons that I won't go into).

GDI+ is good for what it is meant to do - draw gui elements. I've used abused GDI+ for simple tile-based map rendering before, it is doable but you have to be careful, especially with transparency, to avoid rendering bottlenecks.

#5 DvDmanDT   GDNet+   -  Reputation: 968

Like
0Likes
Like

Posted 19 March 2012 - 12:30 AM

You should really give XNA a chance, it's a great library and toolchain. It is indeed a bit different from SDL, but not very different from Direct3D 9. Or were you talking about DirectDraw when you said DirectX?

#6 EFileTahi-A   Members   -  Reputation: 130

Like
0Likes
Like

Posted 19 March 2012 - 04:00 AM

Thank you all for the replies!

Postie:
I tried already SlimDX but the lack of examples pushed me away. The small differences they state for the "easy" translation between DirectX and SlimDX tutorials are enough to don't let me achieve nothing. Although SlimDX seems to have a solid development rate, I prefer to loose time with something even more certain like a gfx lib from a bigger corp (aka Miscrosoft). Nonetheless I'm the one to blame for my poor DirectX skills.

Dynamo_Maestro / DvDmanDT:
I actually did tried XNA yesterday, but after a huge battle on how to render it on a panel I gave up. I need to build an engine capable of rendering to a panel inside the editor and into a form for the game's output. These conditions are non-negotiable. I know its possible to do this but the examples I tried were too confusing for me.

laztrezort :
Yesterday, late in night, and after testing SlimDX and XNA, I managed to increase the render speed of GDI+ drastically. It turns out that if I pre-render the full map into a huge BMP and then if I just render a cropped area into the screen the efficiency is absurdly increased! I even tried rendering a 4800x4800 map into a estimated 2500x1100 screen size (the editor's form stretched between my 2 screens) with an average speed of 50fps! This is definitely more than enough! Since my tiles have fixed sizes 48x48 they don’t overlap, making constant map updates scarce. I just need then to draw the units and other interactive objects over the cropped map.


Just out of curiosity, what would you say about Silverlight and WFP for simple 2D games?


And just to finish, if I actually needed a step-by-step example on how to deploy a XNA device into a panel would someone care to do one? Because, I might had found a solution for now regarding GDI+, but I now in future it won’t be enough, I guess…
"Sometimes you may think you're alone but that's not true, where ever you go, Death is always near and always watching you." By me January 2007

#7 DvDmanDT   GDNet+   -  Reputation: 968

Like
0Likes
Like

Posted 19 March 2012 - 06:03 AM

I haven't seen any examples using WPF (never looked) but Microsoft has an example on how to use it with WinForms. It's somewhere on creators.xna.com. It comes with a Xna control which you can just place on your form like a normal Panel or PictureBox. The problem with Xna in an editor is just the content pipeline, which can indeed be quite annoying.

#8 EFileTahi-A   Members   -  Reputation: 130

Like
0Likes
Like

Posted 20 March 2012 - 03:51 AM

I really miss Managed DirectX Posted Image
If only I knew Managed DX libs would continue to function for some years I would still use them.
"Sometimes you may think you're alone but that's not true, where ever you go, Death is always near and always watching you." By me January 2007

#9 DvDmanDT   GDNet+   -  Reputation: 968

Like
0Likes
Like

Posted 20 March 2012 - 04:41 AM

SlimDX and SharpDX will continue to work in their current state, and they are said to be very similar in their APIs, meaning it would be easy to replace one with the other should one be discontinued. Though, at that point, you would need to rewrite your engine anyway to make use of the new features missing. Both of them already have full support for DX11. SharpDX is generated from headers, so supporting DX12 when it comes out will probably be trivial.

#10 EFileTahi-A   Members   -  Reputation: 130

Like
0Likes
Like

Posted 20 March 2012 - 09:13 AM

DvDmanDT they are familiar but lack tutorials. Anyway, I've discovered Gorgon lib, it seems it does exactly what I need. Fast 2D in a simple and easy way. I'm going to try it today, once I get home.
"Sometimes you may think you're alone but that's not true, where ever you go, Death is always near and always watching you." By me January 2007

#11 Postie   Members   -  Reputation: 1087

Like
0Likes
Like

Posted 21 March 2012 - 08:37 PM

Re: SlimDX, I agree it does seem to lack good tutorials, but what I've found is that since SlimDX is a wrapper for the Direct3D libraries, I just use DirectX tutorials and translate the code myself without any real dramas. In fact, one of my most consulted resources at the moment is "Introduction to 3D Game Programming with DirectX 9.0c: A Shader Approach", which goes nowhere near SlimDX.


Though that said, I'm targeting dx9, and the dx10/11 tutorials seem like Greek to me, so I'm not sure if the same idea holds for newer dx versions.
Currently working on an open world survival RPG - For info check out my Development blog: ByteWrangler




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS