So anyway, I now just increase X by the width of the glyph on the texture, and I keep track of the tallest glyph on that row so I can advance downwards a bit more whenI run out of space on that row. I was quite surprised that it worked first time.
The main reason I was doing what I did before was so I could unload random glyphs whenever I wanted to. However, that's just silly - why would I ever need to? I added the ability to trash all textures used by a font, which will free texture memory, at the risk of duffing up any fonts that are active. Still, useful for doing when changing graphics state (E.g. front end -> in game).
Still to do: Word wrap. Once that's done, I'm considering my 2d engine code "Done". I can do pretty much anything I want now, I can draw 2d quads (sprites) with or without a texture, blended with a (single, not per-vertex) diffuse colour, I can draw text in a rectangle with left, center, right, top, middle, bottom alignment (Like DrawText()), I'll soon have word wrapping, and the fonts can be any system font, unicode, bold, italic, stikeout, underline or any combination of the above.
I'm debating doing 3D stuff just now or not. I want to have a bit of a code tidy / optimize, then I'll probably release what I have for people to play with / inspect.
I have a weeks holiday at the start of September, so I want to get some serious work done to TEH MMORPG!!1 (As in, working 9 hours a day or so on it), and I'd like to get some articles and things written for both my site and GameDev.Net if they want them. Articles I'm going to be writing include:
And I have more on my list at home, but that's all I can think of just now.
Let me know if there's any others you'd like to see.
# Creating a texture manager with texture palettes in D3D9
I'd read these. I've yet to implement any resource mangement with D3D9.
I'm interested in testing your 2D engine out.