Sign in to follow this  

ID3DX10Font DrawText .. internally

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

Does anyone know how DrawText works internally? For example... it creates a vertexbuffer on the fly, draws it, discards it. Or... creates a small texture with the whole text, draws a single quad, discards the texture. Or whatever else. I will need to output massive and ever changing amounts of text so I am evaluating whether coding a variable size bitmapped font system is worth the effort or not, given that in any case I see massive creation/destruction of vertex and index buffers on the horizon.

Share this post


Link to post
Share on other sites
I've moved ahead and performed some tests. Wow, DrawText must do something complex for sure, because for some reason immediately after I call it, a completely unrelated vertex buffer gets screwed. I've tried resetting everything, thinking that the call to DrawText could have affected the technique in use, some matrix, the vertex layout, whatever... but nothing worked.


Edit: I didn't properly restore the vertex layout and, well, that was the problem. So looks like DrawText arbitrarily changes the vertex layout! All but good news, performance-wise, since - correct me if I am wrong - changing the vertex layout is one of the most expensive state changes, right?

Share this post


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