Coder
Still Fresh
Hi,
I think I must be doing something wrong here but I'm just not familiar enough with SDL programming to figure out what exactly.
I'm using the official SDK (gp2xsdk_windows.zip) and have created a new project, DevC++ kindly creates a template for it which compiles and runs without problem.
So, as a test I decided to do a "hello world" program. No problems adding SDL_ttf to the includes and I can call TTF_init and TTF_close.
The problem arises when I call TTF_OpenFont. Every time I add it I get a segmentation fault (access Violation). The code I'm using looks like this:
TTF_Font *font;
font=TTF_OpenFont("ariel.ttf", 16);
if(!font) {
printf("TTF_OpenFont: %s\n", SDL_GetError());
// handle error
}
The ariel.ttf file is in the same directory as the application.
I'm stuck now as I can't figure out what is going wrong.
Any help would be appreciated.
I think I must be doing something wrong here but I'm just not familiar enough with SDL programming to figure out what exactly.
I'm using the official SDK (gp2xsdk_windows.zip) and have created a new project, DevC++ kindly creates a template for it which compiles and runs without problem.
So, as a test I decided to do a "hello world" program. No problems adding SDL_ttf to the includes and I can call TTF_init and TTF_close.
The problem arises when I call TTF_OpenFont. Every time I add it I get a segmentation fault (access Violation). The code I'm using looks like this:
TTF_Font *font;
font=TTF_OpenFont("ariel.ttf", 16);
if(!font) {
printf("TTF_OpenFont: %s\n", SDL_GetError());
// handle error
}
The ariel.ttf file is in the same directory as the application.
I'm stuck now as I can't figure out what is going wrong.
Any help would be appreciated.