• Advertisement

Archived

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

D3DXSprite, D3DDEVTYPE_REF, general 2D coding methods

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

Here is where i've got confused: My graphics card refuses to work with D3DDEVTYPE_HAL, so I use the D3DDEVTYPE_REF one. I've got one 64x64x16 sprite on a texture and use D3DXSprite to display it. Sprite needs to be presented 20 times on the screen. One of them should bounce a little. Swap effect is set to FLIP. Which method am I supposed to use when rendering each frame? : 1.clear frame, draw sprite 20 times in a loop, draw the one that bounces shifted (I've already figured out how to make it animate independently from the framerate, so it's not a problem). Present the frame. 2.do NOT clear the frame. Instead erase just the sprite that needs to be animated and redraw it. Present the frame. Of course second method is faster, but I'm still not convinced about using it. Is the first method the proper way it should be done? I suppose it should be fast on systems with 3d hardware? I can see one solution: go for DirectDraw. But then I will need to rebuild a lot, so I wanted to seek final confirmation. Just one last thing. Which method should be used with DirectDraw? Waiting for the words of wisdom. [edited by - uzi on April 17, 2002 10:58:59 AM]

Share this post


Link to post
Share on other sites
Advertisement
Ok, I have managed to test the game on systems with _better_ graphic cards (ie. that support 3D acceleration), and second method works very well.
First method saves a lot of computing time, but produces confusing and error-sensitive code - with second method my code is just neat and simple to write

Share this post


Link to post
Share on other sites

  • Advertisement