Improve my text life... please

Started by
3 comments, last by trager 20 years, 6 months ago
wouldn''t it be nice if there was a function which let you put text onto a designated bitmap, in a speicified place and using a specified colour? some like: text(bitmap_ptr,x,y,r,g,b,"arrrrrrrrrrrrgh"); I mean that would be lovely wouldn''t it? I may even get some sleep by the end of the month if someone can point me toward something like this. Please. Yes I have read, used and modified Lessons 13,14,15 and 43 just that I feel I am reeventing the wheel so if you know and good text functions could you please point me to them. With thanks trager
Advertisement
if you use openGL with SDL you can use SDL_ttf.

http://www.libsdl.org/projects/SDL_ttf/
Just had a quick look and it doesnt appear that it renders text to bitmaps, can you confirm this please.

Thanks

Trager
It renders to SDL surfaces. They''re bitmaps, and SDL can convert them to pretty much whatever format you might want them in--look at the docs.

If you wanted to use this in GL, what you could do is create the SDL surface, clear it, render the text to it, then upload the surface to the GL the normal way.

Rendering truetype is NOT FAST though, so this probably isn''t what you want to do if you want text changing every frame.
Orin Tresnjak | Graphics ProgrammerBethesda Game StudiosStandard Disclaimer: My posts represent my opinions and not those of Bethesda/Zenimax, etc.
Sounds interesting Lancekt I''ll look into it, as it happens I don''t need to update the text every frame.

thanks

trager

This topic is closed to new replies.

Advertisement