User Interface

Started by
11 comments, last by jtmerchant 20 years, 4 months ago
Does anyone else have another way of doing this?
Advertisement
Similar to cynicalpenguin, I write the entire alphabet to a texture during initialization. But when I draw the text, I lock the VB, and then for each character, I add 4 vertices, with the appropriate texture coordinates (which could be looked up from an array also created during initialization), until my VB is full. I unlock it, draw it, and then lock and continue adding more characters. I do this until the entire string has been rendered. If I''m not mistaken, I believe this is how DirectX''s font class works, and I can''t think of a faster method myself for dynamic text. Either way, unless you''re drawing massive amounts of text per frame, or working on a very old computer, drawing even one whole screenful of average sized text shouldn''t be a large issue. The only limitation is that it is harder to deal with formating text nicely. You''d need another texture for every different font face or style.
Yeah, last night in bed I realized I was smoking crack. Go with what AP said. In my rush to save space on vertices I didn''t realize I was wasting more with textures.
It's time for a revolution I say! A revolution!

This topic is closed to new replies.

Advertisement