Jump to content
  • Advertisement

Archived

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

vic_semionov

2D in DX

This topic is 5333 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

Hi I need to know how to do 2D graphics in DirectX. There is no DirectDraw any more (even in the docs), so do I do it with D3D? Why did Microsoft abandon DDraw, 2D graphics are used a lot?

Share this post


Link to post
Share on other sites
Advertisement
They didn''t get rid of it per se. They folded it into Direct3D. Now you create quads and texture them with your sprite and then display them on the screen.

If you want you can always use the DX7 interfaces with the latest SDK, but not if you are going to use the D3D interface, MS recommends not mixing and matching different version of the interfaces.

Share this post


Link to post
Share on other sites
It's not abandoned. It's just deprecated. The ddraw.lib file still ships with directX 9 for backwards compatibility. You can use it, but D3D does have some functions built in that are similar to DirectDraw, even easier than DirectDraw. I would recommend using them. I'm at work right now or I would provide some further details, I'll try when I get home. In the mean time, look up information on using Sprites(ID3DXSprite) and surfaces in D3D.

Good luck,
Chris

[edited by - Supernat02 on January 13, 2004 3:23:33 PM]

Share this post


Link to post
Share on other sites
Building on Chris''s statement. I am sorry thought you just wanted a small answer. But if you are going to use what he stated look up.

D3DXCreateTextureFromFile(...)
D3DXCreateSprite(...)

This will have you blitting to the screen. They are helper functions part of the D3DX library that exists outside of DX but I find them helpful, so long as you are not making a top of the line Doom3 killer game. Also I believe it only supports JPG, BMP, TGA, PNG, and DDS you will have to look in the docs to get a more accurate list.

Hope this helps you some more!

Share this post


Link to post
Share on other sites
you can still get documentation for directdraw in the MSDN library archive... it''s way at the bottom of the list in the MSDN library.

what I did was surf around Microsoft''s website for like a whole half-hour looking for the DX7 SDK just so I could get the docs on my harddrive and not be at the mercy of MSDN. The best I could do was the DX7a SDK but that''s good enough. You can get it here.

Share this post


Link to post
Share on other sites
quote:
Original post by TempusElf
you can still get documentation for directdraw in the MSDN library archive... it''s way at the bottom of the list in the MSDN library.

what I did was surf around Microsoft''s website for like a whole half-hour looking for the DX7 SDK just so I could get the docs on my harddrive and not be at the mercy of MSDN. The best I could do was the DX7a SDK but that''s good enough. You can get it here.

The DX9 Extras download includes docs for DX7.



Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
quote:
Original post by DrunkenHyena

The DX9 Extras download includes docs for DX7.




oh cool... good to know... I hope they keep providing the docs for DD

related question:
if I use only directdraw but compile with the libs and header files that came with DX9, what''s the runtime requirement for my game, DX7 or DX9?

Share this post


Link to post
Share on other sites
thanks for being helpful, guys
i''m not familiar with D3D, but i dont like the fact that a simple 2d sprite that should get blitted has to be treated as a texture, applied to a 3d quad. why do MS always make simple thing boring to write, and we always have to write like a hundred lines of init just to do a BitBlt.
whatever

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
the answer lies with the hardware, not really with microsoft.

In the days when DD was introduced, 2D cards had blitting engines. Now, they are built around vertices and textures. Yes, the API could hide that from you, but why?

the blitter paradigm doesn''t really mesh well with the idea of alpha blending, polygonal regions, overlapping z values, etc. etc. etc. Overall, it''s better for you if they don''t try to shoehorn old concepts on top of new capabilities.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!