[SDL] I can't get to SDL_ttf work

Peter Mulholland darkmatter at freeuk.com
Wed Nov 15 14:17:08 PST 2006


Hello Eric,

Wednesday, November 15, 2006, 12:45:42 PM, you wrote:

> I developing under cygwin (and I'd like to be able to compile my 
> projects under MSVC++ too) and I need to be able to print some simple 
> text in my SDL programs. I can't build SDL_ttf myself (see thread 
> above). Someone sent me a mingw build of SDL_ttf off-list and my 
> programs compile and link using it but exit right away.

"Exit right away" isn't very helpful - why not run your program
through GDB or even add some printf() debugging and find out where
it's causing an exit?

> I don't like glut but I really miss glutBitmapCharacter() now. What 
> should I do? I *need* to be able to print some simple text in my SDL 
> programs (cout in the underlying console is not good enough for me) and
> I want to continue using SDL but right now it seems I have no choice but
> to go back to glut. :-(

You could create a bitmap with the contents of a font you'd like to
print, and then use the blitter functions with appropriate rectangles
to print strings. This would be faster than using TTF fonts if you
don't want resizable fonts or Unicode stuff.

-- 
Best regards,
 Peter                            mailto:darkmatter at freeuk.com





More information about the SDL mailing list