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 );
SDL: font giving NULL value
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement