Jump to content
  • Advertisement
Sign in to follow this  
starnix17

Problems with SDL_ttf and Xcode [Solved]

This topic is 4076 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
Advertisement
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
i am using:
TTF_RenderUTF8_Blended(font, zeilen.cString(), maincolor);
and it works fine.

Share this post


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!