Sign in to follow this  
DenStoreKlinge

XNA vs DirectX

Recommended Posts

Just created an XNA project, where I had 5000 sprites to jump around in a 400x400 window at about 60 FPS, very snoothly. XNA is quite good, but to deploy the application it requires the XNA redist. to be deployed too. So instead I try the same in DirectX 9, but I get low FPS and very laggy sprites at best. I assume I must be doing something wrong when writing to the device using a sprite. I am calculating FPS and I get around 10-15 FPS with about 20 sprites, which can't be right. So if anyone can post a link/downloadable/compileable C# solution, which demonstrates how to move many sprites (a simple PNG image) and/or text very smoothly in DirectX9, it would be really helpful. Some simple code that demonstrates how to setup the device, sprites, font, texture etc. TIA

Share this post


Link to post
Share on other sites
1. What do you mean when you say "DirectX9"? Are you talking about Managed DirectX? If you are, I would recommend that you stop using it immediately. It's a dead project that is no longer updated by Microsoft. If you're just looking for a managed DirectX wrapper SlimDX is a much better alternative, or if you'd also like 360 support plus a game-creation framework than XNA is also a much better choice.

2. DirectX has its own runtime that you'll need to redistribute, so I'm afraid you're not going to avoid that by ditching XNA. XNA simply includes that runtime as part of its redist package.

Share this post


Link to post
Share on other sites
1. I mean ANY DirectX that will do the job, managed or unmanaged. I will take a look at SlimDL.

2. I would prefer XNA, but I'm currently on Framework 2.0 and the click-once feature seems to not support it as prerequisite until 3.0/3.5 .. I could be wrong about that, have not checked it that much. I tried to create a setup for it, but the installation keeps failing on OS's which are not predefined for XNA already.

TY for the reply.

Share this post


Link to post
Share on other sites
Downloaded SlimDX and the first thing I did was to load the sample solution for the VS2005 C#. Fx. in the SimpleText.2005 the line "form.Paint += (o, e) =>" is not a valid syntax. So, when compiling it gave me a bunch of errors.

When trying to run the .exe file from the sample, it crashed.

Think I'll stick to XNA, at least it works out of the box. Besides, I got the XNA and DirectX9 included as prerequisites in the click-once. So when installing on a new PC, it runs the first time.

Share this post


Link to post
Share on other sites
SimpleText is part of the beta stuff, which is why it doesn't work. It's also VS 08 only -- shipping an 05 version is a distribution mistake I'm afraid. The other samples that aren't Direct2D or DirectWrite should be fine. I admit that this isn't clear at all, and with our next release (which...uh...we're waiting on Microsoft here), that will all be fixed up properly.

Share this post


Link to post
Share on other sites
One good point about using XNA is you can easily distrubute a build to the 360, dont rule that out. And plus its much easier to get a completed product using XNA then a one man army stunt with C++/DX. C sharp is very powerful and if you use it properly, the speed loss can be easily worth it.

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