Sign in to follow this  
rudeness

2D in DirectX 9

Recommended Posts

My guess is that it's probably like doing 2D in OpenGL (sorry I don't use Direct3D, so I hope I can help).

Look up how to set a 2D projection mode (also called "orthogonal" mode).

Then it's simply a matter of using normal 3D stuff, but just making all the Z axies 0 (unless you want to use the depth buffer).

Share this post


Link to post
Share on other sites
In Direct3D there are twoways of doing 2D in (D)3D. (Of course there are more, but these are more commonly used).

1) Use textured quads. Using transformed vertices (the ones with X, Y, Z and RHW) to make 2 screen-space triangles, and texture those to form a textured quad. (All this using X and Y as screenpixels)

2) Simply use the ID3DXSprite interface, which handles all of option 1, but also adds more functionality and simplicity. Just look for tutorials on it (the SDK documentation is a good start, the DirectX Forum FAQ (on this board) too). Here's a direct link to DX9 tutorials.

I'd recommend using option 2, because it's more user-friendly, and it allows you to develope faster. In case you're wondering whether to use option 1 or not, don't! Just don't. Instead of learning more, you'll actually be wasting time. At some point when you go into real 3D, you'll understand option 1 and you'll be glad you picked the other/better way.

Share this post


Link to post
Share on other sites
From what I have gathered Microsoft are trying to phase out DirectDraw and have totally redesigned the 2D features of Direct3D in DirectX 9 to provide an alternative. Direct3D will provides a simpler way to do 2D the only real problem is a lack of tutorials for it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It does still exist, it's just depreticated, and nowdays you get better preformance using a 3D API than a 2D API, hardware standards aim more towards 3D Acceleration.

Decsonic

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