[SDL] TTF_OpenFont error

Started by
2 comments, last by sheep19 16 years, 2 months ago
For some reason I am having trouble with opening a font. My error comes back "couldn't open font". I am using Code::Block gcc. Any ideas?

//Initialize SDL_ttf
    if( TTF_Init() == -1 )
    {
        return;
    }
    //Open the font
    TTF_Font * font = TTF_OpenFont( "lazy.ttf", 28 );
     //If there was an error in loading the font
    if( font == NULL )
    {
        char* error = TTF_GetError();
        return;
    }

Advertisement
Well, are you sure that "lazy.ttf" is somewhere that your program can find it?
Figured it out, I had to do a clean and rebuild....code blocks is touchy
I`m having the same problem with DEV-C++. I will do what you did. :)

This topic is closed to new replies.

Advertisement