Jump to content
  • Advertisement
Sign in to follow this  

Rendering textures

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

Quick question on textures. What is the difference between using a sprite to render textures, and using a box of vertices? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Not a lot really - the D3DX sprite/ID3DXSprite interface is more of a convenience than anything magical... just makes it a bit easier to code up 2D rendering.

I suppose the only real difference is that a custom solution allows you more scope to, well, customize... last I checked the Sprite class renders the entire texture you assign to it which isn't very good if you want to use texture atlas/palette techniques for example.

hth
Jack

Share this post


Link to post
Share on other sites
In addition, ID3DXSprite is pretty optimized - instead of just rendering one texture at a time, it can batch many of them at once. Note that most of the time, ID3DXSprite::Draw() won't actually draw the quad - it just stores it for later. It is Flush() that does the real work.

Note that this optimization is quite easy to do - however, it is just handy to already have it coded for you [wink]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!