开发者

DirectX 2D drawing with Vb.net

开发者 https://www.devze.com 2023-04-08 05:48 出处:网络
I\'m using using System.Graphics for my latest project (A simple 2D application).Problem is, it gets a horrible FPS and I\'m only drawing 8x8 tiles (usually 10-12 is enough to bring it down to 12FPS).

I'm using using System.Graphics for my latest project (A simple 2D application). Problem is, it gets a horrible FPS and I'm only drawing 8x8 tiles (usually 10-12 is enough to bring it down to 12FPS).

A friend of mine suggested that I use DirectX. He also suggested XNA but I opposed because I don't want my clients to have to install the XNA distributional. DirectX is common enough (to my knowledge) and I can just include the dll's if I need to.

So, my search began. I've been looking o开发者_如何学Cnly for DirectX 2D tutorials for VB.net. I've had no solid success thus far. In truth, all I need to do is be able to draw bitmap x at position pos.

I've been using System.Graphics and a hacked up bitmap as my buffer thus far so I'll go for any improvement that I can get.

I'm using VB.net so I'll be ok if you give my one for C#, I'm pretty good at being able to read it (and I have a nice converter too). I would just prefer VB.net to save time.

Thanks! :)


This article in MSDN Magazine was in 2003 edition had a nice example of managed DirectX code in action: http://msdn.microsoft.com/en-us/magazine/cc164112.aspx

Sadly enough, currently, there's no managed library of DirectX (a.k.a. DirectX .NET wrapper) in DX 10 and DX 11. Microsoft only provided managed library for DX 9.0a and DX 9.0b.

In Managed DirectX wikipedia, you'll see that it's being replaced by Microsoft XNA.

If you download current/latest DirectX SDK, you will have samples only in C++ and HLSL codes.

If you really need fancy UI and also nice animation and 3D drawing based on DirectX, you can go use WPF, especially WPF in .NET 3.0 SP2 (or simply download and install .NET 3.5 SP1). WPF is build on top of DirectX 9.0c stack, without worrying to know large libraries of DirectX 9 API. You'll also get 3D primitives support too.

More on WPF, visit this: http://msdn.microsoft.com/en-us/library/ms754130.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消