2D in DirectX (8.0, 9.0)

Started by
9 comments, last by deadimp 18 years, 9 months ago
I cannot find anything about 2d graphics in the directx sdk help files. Must I used the interfaces of DirectX 7? If not where are these capabilities gone to?
[ my blog ]
Advertisement
ID3DSprite interface allows you to
do 2d graphics. There is some info about it
in the sdk.

Tjaalie,
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
http://www.gamedev.net/reference/articles/article1972.asp

And, as Tjaalie said, check out D3DXSprite.

-Trond
-Trond
Thanks, i'll do that right away
[ my blog ]
for a newbie like me it's quite hard to understand DirectX SDK...
tried looking in google but hadn't found anything about 2D - Sprite using in games...
I saw the links and they are great for sprites (skimmed them)
However am searching for how to draw lines, rectangles and basic stuff like these.
Isn't this what DirectDraw was responsible for...

In other words am search for DirectDraw in DirectX 9
(Because I bought Tricks of The Windows Game Programming Gurus from amazon). It seems it depends on the DirectDraw7 interfaces which DirectX 9 lacks
[ my blog ]
Quote:Original post by arithma
I saw the links and they are great for sprites (skimmed them)
However am searching for how to draw lines, rectangles and basic stuff like these.
Isn't this what DirectDraw was responsible for...

In other words am search for DirectDraw in DirectX 9
(Because I bought Tricks of The Windows Game Programming Gurus from amazon). It seems it depends on the DirectDraw7 interfaces which DirectX 9 lacks


DirectDraw no longer exists in versions of DirectX starting in 8.0 and up. However DirectX 9 is fully backwards compatible with previous versions of directX. What this means is that it is possible to use the directdraw7 interfaces almost exactly as the book describes. The only thing you should do besides what the book shows is define the directX version your using so that your application knows you want to use the directx version 7 interfaces rather than the 9.0 interfaces. (and include the correct headers/lib files as well)

That said, if you want to proceed with making direct3d applications the "basics" aren't the same as what lamothe has shown. "Basics" in direct3d or openGL for that matter consist of getting setting up the 3d end of things, creating a quad (2 triangles) and rendering a texture to them. Then transforming that quad around in world coordinates. Applying lighting/shading to these quads, and finally animating them. Drawing lines would be considered an "advanced topic" (http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/programmingguide/AdvancedTopics/LineDrawing.asp)

If you want to get the basics of direct3d down I suggest doing the 6 tutorials in the SDK: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/programmingguide/tutorialsandsamplesandtoolsandtips/tutorials/tutorials.asp
That should get you started.
Joseph FernaldSoftware EngineerRed Storm Entertainment.------------------------The opinions expressed are that of the person postingand not that of Red Storm Entertainment.
I always use 3d for these cases: set FVF to something with D3DFVF_XYZRHW, turn off the z-buffer, lighting, and draw 3D lines that are actually 2D with some Z between 0 and 1. It works fine for me :)
The same with textures: create a "3D" rect and apply texture to it.
MSDN's DirectDraw7 reference can be found here: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddover_7dx3.asp
Quote:Original post by evaclear
However DirectX 9 is fully backwards compatible with previous versions of directX.

Why then D3DXFont changed so much from original sdk to june 2005 update? My code won't compile because tha parameters have all changed.

[Edited by - ReaVeR-Andrey on July 19, 2005 2:48:09 PM]

This topic is closed to new replies.

Advertisement