2D in DX

Started by
14 comments, last by vic_semionov 20 years, 3 months ago
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?
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.
In the making Tread Wars - Tank Battle gamePowered by SKEnginehttp://www.highendgaming.com
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]
Chris ByersMicrosoft DirectX MVP - 2005
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!

In the making Tread Wars - Tank Battle gamePowered by SKEnginehttp://www.highendgaming.com
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.
Can''t you combine DirectDraw with direct3d as well to make GUI interfaces I think i saw this in a game engine once.
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
Stay Casual,KenDrunken Hyena
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?
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
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.

This topic is closed to new replies.

Advertisement