   Text rendering (ID3DXSprite)
  I've been playing around with text rendering using ID3DXFont and DrawText.  I've read that passing in an ID3DXSprite speeds things up somewhat, although how isn't clear to me.  Apparently if you're drawing lots of strings, it means DrawText doesn't have to flush its own internal sprite quite so frequently, i.e. it uses the one sprite for all DrawText calls, which is obviously more efficient.The question I've got then, is how best to organise my text drawing class.  Assuming my text strings can change frequently (not every frame of course), is it best for me to maintain one sprite object for all of my strings, or one per string?  I suppose at root I'm not really understanding how it works.  I assumed internally DrawText will render to the sprite and then I just draw the sprite, rather than use DrawText when I render the scene?Thanks.   
Quote:Assuming my text strings can change frequently (not every frame of course), is it best for me to maintain one sprite object for all of my strings, or one per string?All you need is one sprite.Quote:I suppose at root I'm not really understanding how it works. I assumed internally DrawText will render to the sprite and then I just draw the sprite, rather than use DrawText when I render the scene?You will have to call DrawText every render pass. The advantage of using a sprite with DrawText is that it's faster because if no sprite is specified every call to DrawText will create/use it's own sprite.So basically you need one sprite and draw all your fonts using that sprite.   ;  Ok got it.  Thanks for the info.   ;  Ahh, does that include if different strings use different fonts?  Should I pass one sprite in per font?   ;Quote:Ahh, does that include if different strings use different fonts?No you can use multiple strings with one font, if you want a different appearance for every string (like bold, italic, etc.) you will have to create different fonts.Quote:Should I pass one sprite in per font?Yes, the same sprite for every font.   