So thats the first one solved... If I wanted pixel dimensions, since I am currently using sdl_ttf for file format support I remember there being a sdl_getrenderedheight/width correct? I assume I could use that for spacing...
So thats the first one solved... If I wanted pixel dimensions, since I am currently using sdl_ttf for file format support I remember there being a sdl_getrenderedheight/width correct? I assume I could use that for spacing...
I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.
what i did was divide texture in 28 x 32 grid for each 256-32 characters (Spacebar is no character, you can manually move caret forward). You can draw each character in the middle of their cell, so you don't need to worry about spacing and relations between them.
For 256x256 texture it would mean 8x9 pixels for each character, leaving a little empty space at bottom. It is well enough for common fonts. 512x512 would allow more detail with 16x18 character size, at great cost of memory use. Still i'd rather use the memory for this rather than draw fonts geometrically. Simple quad will always be 100 times faster to render especially if you optimize it with arrays, displaylists or such.
The idea was to fix the slowness of nice fonts from sdl_ttf. sdl_ttf is nice for loading and thats about it. Thus if we load the font with sdl and then draw a greyscale version to a texture and the free the sdl font, we can simply do a glcolor and quad draw from the texture which should be 1.5million times faster... Still, it seems my co-ord calculations are not quite up to scratch yet as I am getting bits of garbled letters everywhere
I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.
Bookmarks