Archived

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

implementing 2d in direct3d

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

I plan to create a 2d engine and im confused on how to implement 2d in direct3d, i found some tutorials that uses the IDirect3dSprite thing but MOSTLY uses texture and quad. I try to use IDirect3dxSprite and created my engine without placing the texture into a quad, it only took me few lines of code than implementing it in quad+texture manner.// Is it necessary to place the texture in a quad? while we can just render a sprite using IDirect3dxSprite? whats the difference between using texture + quad in implementing sprite in D3d and using the IDirect3dxSprite thing... HELP ME im confused....

Share this post


Link to post
Share on other sites
There''s two ways to do it:

1. Use vertices and texture coordinates to draw quads
2. Use the ID3DXSprite and textures and ignore vertices altogether.

I''m currently working on the same project as you and I''ve begun to lay out a nice design. Feel free to mail me if you wish to talk about techniques.

stryker777_at_hotmail_dot_com_

Share this post


Link to post
Share on other sites
ID3DXSprite is the easiest way to draw 2d.

And it can use AlphaBlending effect and so on easily.

You only want to do is to init the D3D,then you can draw with ID3DXSprite

Share this post


Link to post
Share on other sites
I posted a similar question just two days ago.
Someone pointed to the StretchRect method. It seems that this one does use the blitter. and so will probably have better performance than going through the 3D pipeline.

Share this post


Link to post
Share on other sites