SDL: font giving NULL value

Started by
2 comments, last by rip-off 13 years, 9 months ago
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 );
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.
I'm using devc++ and i assume the working directory is default the same location of the exe. I load in pictures just fine.
Have you tried looking at what TTF_GetError() says?

This topic is closed to new replies.

Advertisement