Why use DirectX Graphics instead of DirectDraw???

Started by
13 comments, last by fernandojorge 22 years, 5 months ago
I''ve seen this question being debated over and over these forums and other places too, but I just can''t seem to understand most people''s arguments: why on earth would the DirectX Graphics API be better for 2D programming than plain old DirectDraw?? Could anyone answer me the following questions? 1. How can DirectX graphics beat in speed, direct surface writing that was allowed by DirectDraw? 2. How can it be easier to draw a 2D world thinking about all those matrices and transformations that DirectX graphics requires?? Could anyone explain this to me? Like I''m a six year old? Thanks anyway, And I''m sorry I sound a little bit revolted (I''m just frustated with all this) Fernando Jorge Silveira Filho Computer Science Department Federal University of Rio de Janeiro Rio de Janeiro, Brazil
Fernando Jorge Silveira FilhoComputer Science DepartmentFederal University of Rio de JaneiroRio de Janeiro, Brazil
Advertisement
I cant really say whether or not DirectX Graphics is any faster or not that simple Direct Draw. If it is dont worry about it anyway because its deifinately not going to give you an extra 10 fps or anything. I can assure you though that to do normal 2D game programming with DX8, you wont need to work with matrices or transformation stages It isnt really that much more difficult than with DirectDraw.

Hope any of this helped
~Vendayan
"Never have a battle of wits with an unarmed man. He will surely attempt to disarm you as well"~Vendayan
Well,

First of all, a 2d application written with DirectX Graphics
(you mean DirectX8, right?) is based on primitives(3D objects),
and today graphic cards are designed to support 3D stuff and
less continue supporting 2D. This is the reason why 3D drawing
is faster than direct access. And remember that nearly all
graphics accelerators support alphablending, which would be very
slow in DirectDraw (except if you are an expert in assembly!!!)

Then, i''ts true that direct access to the memory is easier than
dealing with 3d primitives. Anyhow, nowadays you should get
familiar with all the 3D stuff, and matrices aren''t really that
difficult. I''m in college in Switzerland and I haven''t seen the
matrices theory yet, but I know how to use them in the context of
3d tranformations. It''s simple, efficient and there''s a lot of
documents about tranformations over the web.

Well, it''s all, you should code your 2d apps with DirectX
Graphics, it''s efficient, fast, and you can access to all
features of your graphics card. If you plan to use DirectX7, try
to combine DirectDraw and Direct3D.
Well, you guys started to change my mind a little bit, but I''ve got to admit, I still get that feeling of "it didn''t have to be this way", but I guess that could be just my feelings about the way things change so fast... I''m not really a game programmer, and I used to do graphics programming a long time ago, back in the times of DOS where the best thing you could wish for was a direct frame buffer access graphics library. =)

I guess I''ll always miss those days... hehehe

Thanks a lot guys!

Fernando Jorge Silveira Filho
Computer Science Department
Federal University of Rio de Janeiro
Rio de Janeiro, Brazil
Fernando Jorge Silveira FilhoComputer Science DepartmentFederal University of Rio de JaneiroRio de Janeiro, Brazil
If you are just talking about placing a bitmap onscreen with no special effects, they might break even. As soon as you start doing anything interesting, D3D8 will pull ahead with increasing significance.

Doing the slightly unfair comparison between D3D on a geForce3 and a specialized blitting API on a 4 year old $10K image processing card, the GF3 wins by a HUGE margin. Granted, the other card is 4 years old, but it was very specialized for 2D graphics (far faster than the 2D consumer cards of the time). The point is that doing it in 3D is definitely not slow if you talk to the hardware the way that it''s tuned for.
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
A further question on this - if i were to use DX8 Direct3D functions to make my fairly simple 2D game, would it be slow on older computers without 3d cards compared to using DirectDraw to do the same thing?
Yes, Direct3D is very slow without any 3D hardware rasterization support. Unless, you dont draw triangles and instead draw rectangles with the CopyRects function, which still won''t be as fast as DirectDraw''s Blt and BltFast functions.
Yep, in that case Direct3D would be slower than DDraw...that''s one of the problems that arise then using D3D for 2D because people with old computers won''t be able to play your game. But now a days almost all people have a graphics card with enough 3D acceleration to meet your requierements. Remember that you dont need to render thousands of vertices, so your framerate depends mostly on the fillrate.

It''s also very easy to integrate 3D effects in you game. For example in my game the mainmenu consists of a spinning cube which has the mainmenu bitmap as texture. Then when the user selects something in the menu, the cube rotates until the selected menu becomes visible. That''s a nice thing, and it would be impossible to integrate something like that in DirectDraw.

-René

Real programmers don't document, if it was hard to write it should be hard to understand

If you are doing a simple 2D game with a broad distribution, then you may have to use DirectDraw despite its limitations. However, if you are trying to learn (about all those matrices, etc.) then it''s probably very worthwhile to invest in a 3D card. At less than $90US, some geForce2MX cards are extremely cheap and let you learn all the latest tricks. Learning DirectDraw at this point is a waste of time unless you specifically need to target pre-1999 cards.
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
It also depends on the features you require, if its a simple space invaders type game, use DirectDraw, otherwise if you want to create something that compares to say a SuperNES game, use Direct3D since it supports alpha blending, rotation and scaling without loss of performance. The only problem is that it will not work on many older systems and almost all laptops since they do not have a decent 3D Accelerator, though 3D cards are getting cheaper and more powerful and popular all the time so by the time you decide to release a game, the majority of PC''s will be able to run the game.

DirectX8 supplies programmers with sprite helper functions that are capable of blitting 2D sprite using Direct3D with minimal fuss, once you get the graphical side up and running, its not all that hard.


Download my D3D-2D Sprite wrapper to see how D3DXSprite functions, otherwise u can use the actual wrapper in your own game.

  Downloads:  ZeroOne Realm

  Downloads:  ZeroOne Realm

This topic is closed to new replies.

Advertisement