• Advertisement

Archived

This topic is now archived and is closed to further replies.

Direct3d? DirectDraw?? HELP!!!

This topic is 6057 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok, I used to program alot in C++ for DOS, moved to Win32 about two years ago, now started to migrate from softwares to games. i''m a quick learner, but when i approached Directx 8, (ive Read all SDK & tuturials) well, i wanted to learn use graphics, but the documentation only refers to 3D. ive been searching for a month for how-to use 2D graphics (nothing biggie, lines&bitmaps) for a game, heard things about direct draw, but microsoft says its all INSIDE D3D and rather hide it. now, if youll be kind enough to answer me two questions i''ll be most gratful (actually, you dont know how much cause i''ve been looking for this for 2 monthes now) 1. whats microsoft''s DirectX''s interface part that handles 2D graphics? and i mean in DX8, why isnt there any documentation?? 2. Documentation for Question 1? tuturials? I just need simple things like draw lines,circles and then some bitmaps. i can go on on my self from there. thanks a WHOLE lot to who ever answer this. consider your feets kissed. ok, i went too far, but you catch my meaning Gil

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You should use DirectX 7 (it''s all contained in the DX8 SDK though, so you don''t actually need the DX7 SDK), it contains the DirectDraw component, while DX8 is more geared towards 3D graphics, and all the DirectDraw stuff is "hidden".

Rumor has it that DirectX 9 will yet again contain the DirectDraw stuff, but for now your pretty much stuck with version 7 (unless you want to "emulate" 2D using 3D primitives, you should be able to find some info on this site about that).

Share this post


Link to post
Share on other sites
so what youre actually saying that microsoft
decided to "hide" all 2D related interface?

idiotic, but sounds like microsoft
ok...

now, does it mean i should have to migrate
back to dx7 or that i can use the same
directdraw in dx8?

Gil

Share this post


Link to post
Share on other sites
I think it is unlikely that MS will reimplement ddraw for dx9, so dont hold your breath.

The reason for getting rid of 2D is simple - there isnt an awful lot of point in it. You can still do 2d using direct3d (textured quads etc) plus you get hardware accelerated scaling, rotation,alpha blending, transparency, lighting etc. for free. In these days of hardware acceleration, 3d is faster than 2d.

There is a cost to this - 3d is a little less intuitive to use and requires a bit more setup. To be honest though, I think the advantages outweigh the disadvantages.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yeah, that''s _indeed_ idiotic. Nothing is more waste than using 3D just for some simple 2D graphics, and it''s way more complex to do too. M$ probably thinks that 2D graphics are not anymore used?

Share this post


Link to post
Share on other sites
Its not idiotic at all - ddraw is still (and always will be) available using dx7 or below. There isnt much point updating it further though, because there is nothing you can do using ddraw that you can''t do better using d3d.

Share this post


Link to post
Share on other sites
Here is the deal. Direct X 7.0 came out roughly 2 years ago. (3 at most). In the past 3 years what have Nvidia, 3dfx, S3, or any other graphics chip maker done to the 2d side of their video cards? Absolutely nothing. Their focus is on 3d. Sure Microsoft could toss in a bunch of functionality for rotating or alphablending in 2d however without the hardware to support these you might as well code it yourself. So the idea was simple. Direct X is backwards compatible with all previous versions. There for using direct X 8.0 you can query the direct draw 7.0 interfaces, and use them. Microsoft even included some direct draw wrappers in the ddutil.cpp and .h files, to show you how to do it. The Direct X 8.0 documentation doesn''t cover direct draw 7.0 however you can download the dx 7.0 documentation from the MSDN website.

Share this post


Link to post
Share on other sites
mind sending me a link to that DX7 documentation?
they hidden it hard enought in their site

10x
Gil

Share this post


Link to post
Share on other sites
Well ms''s site is extremly difficult to post links to and have them work correctly. Let me just give you directions instead.

Goto: http://msdn.microsoft.com/directx/

Over on the right hand side of the screen look for the RELATED LINKS box. Choose DIRECT X DOWNLOADS.

Now you''ll notice on the left hand side of the screen you have an extended data tree.

Click on the Direct X 8.0 Partial SDK downloads.

Now over on the right hand side of the screen you have a bunch of links. One of which is the direct x 7.1 documentation downloads.

Share this post


Link to post
Share on other sites
Yeah, DX7 will do it for you if you want to stick to 2D. I suspect the whole "3D only" thing is a plot by Microsoft to get all those folks that don''t have adequate 3D cards (uhm, that''s the greater portion of the populace) to upgrade to GeForce-class cards whether they need to or not! That ought to improve cashflow and boost the economy... lol..

It''s not as hard to do 2D in 3D as it may appear, however, and there are a couple of good articles (here and on www.gamasutra.com ) on how to do it. If you can get a quad to render, you can do 2D with 3D - just don''t expect acceptable performance on machines without a decent 3D accelerator...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
This topic came up about an article posted on this site about a week ago, so first, you might want to hunt up that thread.

About 2D graphics in DirectX 8: you can do anything that you could do in DirectDraw using the Sprite interface from D3DX: ID3DXSprite. Search the SDK for exact use of it. There isn''t a whole lot of documentation on that interface for some reason, but you should be able to find enough in the SDK and on the net to get you going. Personally, that''s the route I''d go instead of using DirectX7''s DDraw since ID3DXSprite has support for many features that DDraw never did.

---Dan

Share this post


Link to post
Share on other sites
About the MS plot...

Think about it - if you''re designing a significant revision to an API, and those revisions are going to affect your API for at least a couple of years, then you make your decision based on current and forthcoming hardware. All of that hardware is optimized for 3D, of which 2D is a subset.

No plot, just good sense.

OpenGL never had a 2D API (there were 2D functions, but in most hardware they are VERY slow). In OpenGL, you just do 2D rendering in "3D space". No MS conspiracy there!

A GeForce2 MX is under $100 and is ALOT MORE than adequate. Spending alot of time to learn an outdated API so that you can save $100 on a card seems like a bad idea. If you total up all the time spent learning, your time should be worth more than $100...

Share this post


Link to post
Share on other sites
2D in DirectX 8 is very easy to do. Being a programming newbie, I''m well aware of the level of technical difficulty at which I start getting confused. The scope of the DirectX 8 SDK is a headache at first, but just take the time to learn how everything is organized and labeled, then understanding the rest (at least the logic behind the syntax) is cake. Then you can get into the meat of DirectX Graphics, which is organized and implemented in a logical, if not somewhat overly complicated, fashion.

Ok, 2D in dx8...

Tutorials:
http://www.flipcode.com/tutorials/tut_dx82d.shtml
http://www.flipcode.com/tutorials/tut_dx8adv2d.shtml
http://www.mvps.org/directx/articles/blit3d.htm
http://www.mvps.org/directx/articles/blit3d.htm
http://www.mvps.org/directx/articles/blit3d.htm

The tutorial on 2D in DX8 here on Gamedev is the best by far, however. Try it first, it helped me get my feet on the ground.

Share this post


Link to post
Share on other sites
quote:
Original post by CrazedGenius
A GeForce2 MX is under $100 and is ALOT MORE than adequate. Spending alot of time to learn an outdated API so that you can save $100 on a card seems like a bad idea. If you total up all the time spent learning, your time should be worth more than $100...



Wrong. See i would have gone out and bought a new video card, but there is one thing standing in my way. See my video for my comp is built in, and there is no AGP slot, and i am not going to use a PCI video card. So actually, i don''t have to save $100, i have to save alot more.

Share this post


Link to post
Share on other sites
Yes, you do represent a special case, where it is harder to upgrade. However, I urge you to consider the long range:

It may be better to invest the $89.15 for a PCI geForce2 MX and learn DX8 then to save the $90.00 and learn an outdated API. Let''s say your time is worth $5.00 an hour and it takes you 20 hrs to become a DX7 guru (I''m guessing your time is worth more and it would take alot longer to become an expert). You''ve just "spent" $100 to learn outdated stuff that is only becoming less and less appropriate.

On the other hand, if you spend $90.00, you get a better card, plus the opportunity to learn an API with a much better long term value.

Alot has changed between DX7 and DX8 and those changes will probably stick for the next couple revisions. Don''t save a couple dollars at the expense of wasting your time...

Share this post


Link to post
Share on other sites
quote:
Original post by Sandman
I think it is unlikely that MS will reimplement ddraw for dx9, so dont hold your breath.

The reason for getting rid of 2D is simple - there isnt an awful lot of point in it. You can still do 2d using direct3d (textured quads etc) plus you get hardware accelerated scaling, rotation,alpha blending, transparency, lighting etc. for free. In these days of hardware acceleration, 3d is faster than 2d.

There is a cost to this - 3d is a little less intuitive to use and requires a bit more setup. To be honest though, I think the advantages outweigh the disadvantages.


G''day!

DirectGraphics9 is supposed to have a DirectDraw-like interface on top of D3D to make 2D stuff easier to do. It will likely be an addition fo D3DX or a separate D3DX-like library. You can find similar wrappers all over the place already.

If you only care about 2D, using D3DXSprite or one of the many third-party wrappers will give you all the benefits that 3D hardware offer (the alphablending, etc) without worrying about the 3D-isms.


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
quote:
Original post by helpo
Wrong. See i would have gone out and bought a new video card, but there is one thing standing in my way. See my video for my comp is built in, and there is no AGP slot, and i am not going to use a PCI video card. So actually, i don''t have to save $100, i have to save alot more.



G''day!

For who can''t (like you because of insufficent hardware) or won''t use D3D there is still DirectDraw7. There is no DirectDraw8 because there isn''t any need for it, there''s nothing left to add. DirectDraw7 will be available as long as DirectX is, so there is no problem using it if it does all you need.

You can use the other DX8 components (sound, play, etc) with DirectDraw7, the only thing you can''t use with it is D3D8.


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Yeah, that''s _indeed_ idiotic. Nothing is more waste than using 3D just for some simple 2D graphics, and it''s way more complex to do too. M$ probably thinks that 2D graphics are not anymore used?


G''day!

Using 3D hardware to do 2D graphics isn''t wasteful at all. With all the benefits (alphablending, scaling, rotation) you get with the hardware support you can do 2D using 3D a lot faster than you could with a plain 2D API.

It''s also not much more complex. There are many articles on how to do it. There are a number of wrappers designed to make it easy (including D3DXSprite which is included in the SDK).

M$ is well aware that 2D graphics are alive and well. DirectDraw7 is also alive and well and will be for a very long time.

Some days I really wish I had Moderator rights so I could delete Anonymous flame-bait like this. There''s just too much of it.




Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites

  • Advertisement