Jump to content
  • Advertisement
Sign in to follow this  
slowburn15

SDL: font giving NULL value

This topic is 2865 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

My problem is exactly this
http://www.gamedev.net/community/forums/topic.asp?topic_id=553496

font = TTF_OpenFont( "times.ttf", 28 );

times.tff is in the same folder as the .exe
TTF_Init() is fine

crashes when it hits this line
surface = TTF_RenderText_Solid( font, "hello world", textColor );

Share this post


Link to post
Share on other sites
Advertisement
The font file is in the same directory as the executable, but is the working directory the same directory the executable and the font file are located? If you're running from Visual Studio, make sure you set the working directory to "$(TargetDir)" (the default is the project directory, the directory containing your project files), or you can try running the executable outside of Visual Studio.

Share this post


Link to post
Share on other sites
I'm using devc++ and i assume the working directory is default the same location of the exe. I load in pictures just fine.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!