Problems with SDL_ttf and Xcode [Solved]

Started by
4 comments, last by starnix17 16 years, 11 months ago
Hi, I've been able to successfully load the SDL, SDL_image, and SDL_mixer in Xcode, but whenever I try to use SDL_ttf I can't get it to display text. Here's what I try to do:

message = TTF_RenderText_Solid( font, "Testing fonts", textColor );
font and fontColor both work, I'm able to check them with if statements. However whenever I try to check message, NULL is returned. Does anyone here have experience with SDL_ttf and Xcode? Thanks for reading, Tony [Edited by - starnix17 on May 23, 2007 10:17:56 PM]
Advertisement
Hmm. Does printing TTF_GetError() after the failed rendering call tell you anything?
Yup,

SDL_UpperBlit: passed a NULL surface


I've tried multiple fonts, and I've tried the code on Windows and it worked fine.

Do I need to compile FreeType myself to get SDL_ttf to work (I wasn't sure if it came with OS X or not)?
I have gotten TTF_RenderText_Solid to work in mac osx. what is font equal to?

this is how I am using in my graphics engine and it works on the mac
m_pLoadedFont=TTF_OpenFont(FontToLoad.c_str(),m_iFontPoint);m_porignalSurface=TTF_RenderText_Solid( m_pLoadedFont,m_sTextBoxMessage.c_str(),m_cColorOfText);



where
SDL_Color m_cColorOfText
TTF_Font *m_pLoadedFont

my guess is that it cannot find the font. I can't remember if you need FreeType or not.

sorry I can't be more help
Black CloakEpee Engine.
i am using:
TTF_RenderUTF8_Blended(font, zeilen.cString(), maincolor);
and it works fine.
Quote:Original post by Eitsch
i am using:
TTF_RenderUTF8_Blended(font, zeilen.cString(), maincolor);
and it works fine.


I just tried that and it worked fine, thanks.

This topic is closed to new replies.

Advertisement