Direct3D vs DirectDraw for 2D games

Started by
29 comments, last by Foggymyst 21 years, 7 months ago
Hello, long time reader-- first time poster. After having browsed through tutorials and articles relating to DirectDraw and Direct3D, I am asking this simple question: If you were going to create a 2D engine what would you use? I have dabbled in both, but I find that it feels unnatural to start a project by choosing DirectDraw, a no longer supported library from an outdated version of DirectX. However, DirectDraw feels easier to work with on 2D games since it is geared at what Im working on. On the opposite end of things, Direct3D has nifty features that would save time (like being able to set a color for each corner of a tile, etc..) when doing a 2D engine. Anybody have any thoughts on this subject? ~Steve www.foggymyst.com
Advertisement
I''d go for (and have gone for) DirectDraw, just because it''s simpler.

I have however made my 2D engine go through an abstract interface as I''m planning on porting it to GameBoy Advance and perhaps an OpenGL renderer, for kicks.

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Sia,

Good idea! I cant beleive I didnt think of that myself-- it would be funnier if you knew how big on abstraction I am. At work, I spend extra time and effort making sure our code has no dependancy on which database system we use. For some reason, that same thought did not carry over into my current dillema.

Still, the question remains... is it bad to go with the aged DirectDraw? =)

~Steve
There are only two (noted) reasons why MS stopped updating DirectDraw:

1) Companies no longer added "cool" 2d features to their graphics cards.
2) There was nothing left to update. It''s so complete that they can''t make anymore additions to it.

If you feel comfortable using DirectDraw, then do it! It''s a great API and will be around for a long time.

If you want to try something new, then go for Direct3D, you get more features with only a small increase in difficulty (it''s well worth it, though).

Hopefully I could be of some assistance.

--SuperRoy

[Google!][Stick Soldiers 2 Screenshot][E-Mail Me!]
[End Transmission]
Sup guys?
I have a complete 2d engine. And I regret using direct draw so much. It's actually the biggest mistake I made in making my engine. Features like fades, you'd think would be so simple are a huge issue with direct draw(you can use gamma controls but then you have to worry about how they'll look on other people's computers or if they'll even work at all). You can't make things transparent without fancy routines that'll slow things down a lot. Direct3d is faster because all of the video card makers focus on 3d acceleration. There's just so much more Direct3D has to offer.

Oh and if Direct Draw and Direct3d aren't my only choices. I would say I'd go SDL and OpenGL to get some platform independence going. I would say look into those two as well.

I think it's safe to say SDL is at least as easy if not easier than DirectDraw to use. If I'm wrong I take it back, don't flame me on that!

And a little disclaimer, Don't take what I'm saying as fact, just opinion.

[edited by - atcdevil on September 8, 2002 9:03:34 AM]
quote:Original post by atcdevil
(you can use gamma controls but then you have to worry about how they'll look on other people's computers or if they'll even work at all).


atc, there's actually a really simple way to do gamma fades on that will look good on any machine. I have a post showing my sample code here. **note** this is some old code and I should have used bitshifting to speed it up, but I was new to C++ at the time**



[edited by - jdinger2 on September 8, 2002 10:50:12 PM]
MSVC++ 6DirectX 7
Either choice would be fine, but it depends on what sort of effects you want really. You get sprite roration and alpha blending for free with D3D. But, DirectDraw will cost you some CPU cycles (or extra bitmaps) to get the same effects. Someone said DirectDraw was easier. I highly disagree. 2D in D3D is cake. DirectDraw takes a bit more work, since you have to implement features yourself which D3D provides for you.
Thanks for your input guys, I think Ill stick with Direct3D.

~Steve
One thing about going 3D is you are limited to using textures. So they are limited in size and they have to be powers of two in size. This is a real pain in the neck for some 2D games.
"I am a pitbull on the pantleg of opportunity."George W. Bush
What if your 2D map is on the order of 1 billion pixels in size -- like 32767 pixels by 32767 pixels (which could be 512x512 tiles for 64x64-pixel tiles -- a total of only 262,144 tiles). A 2D DirectDraw-based engine could handle this no sweat on any old PII system with 64 MB RAM and 4 MB video memory -- does it present problems for Direct3D?

"All you need to do to learn circular logic is learn circular logic"
"All you need to do to learn circular logic is learn circular logic"

This topic is closed to new replies.

Advertisement