Sign in to follow this  

Problems with SDL_ttf and Xcode [Solved]

This topic is 3858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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)?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Quote:
Original post by Eitsch
i am using:
TTF_RenderUTF8_Blended(font, zeilen[i].cString(), maincolor);
and it works fine.


I just tried that and it worked fine, thanks.

Share this post


Link to post
Share on other sites

This topic is 3858 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this