Coleman Nitroy
2004-04-16 04:08:26 UTC
Documentation for SDL_ttf seems a it lacking so I am stabbing the the
dark here, and from the demo and documentation I was able to scrap
together this for initializing SDL_ttf, but it crashes and burns
every-time:
[Code]
TTF_Font *font
char *filename
// This works
if( TTF_Init() == -1 ) {
fprintf(stderr, "Unable to initialize SDL_TTF: %s\n", TTF_GetError());
return 1;
}
// This is where it burns
filename = FreeMono.ttf";
font = TTF_OpenFont(filename, 9);
if( font == NULL ) {
fprintf(stderr, "Unable to open default TTF font: %s\n",
TTF_GetError());
return 1;
}
[/Code]
---
Coleman Nitroy
nitroy.com/cole
dark here, and from the demo and documentation I was able to scrap
together this for initializing SDL_ttf, but it crashes and burns
every-time:
[Code]
TTF_Font *font
char *filename
// This works
if( TTF_Init() == -1 ) {
fprintf(stderr, "Unable to initialize SDL_TTF: %s\n", TTF_GetError());
return 1;
}
// This is where it burns
filename = FreeMono.ttf";
font = TTF_OpenFont(filename, 9);
if( font == NULL ) {
fprintf(stderr, "Unable to open default TTF font: %s\n",
TTF_GetError());
return 1;
}
[/Code]
---
Coleman Nitroy
nitroy.com/cole