SDL segfault when trying to draw to screen
Code:
if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 )
{
printf("Unable to init SDL: %s\n", SDL_GetError());
exit(1);
}
atexit(SDL_Quit);
screen=SDL_SetVideoMode(1024,768,32,SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_FULLSCREEN);
if ( screen == NULL )
{
printf("Unable to set video: %s\n", SDL_GetError());
exit(1);
}
drawString(screen, font, 0, 0, "Loaded!\n");
It Segfaults at the drawString.
I've tried blitting surfaces to the screen and all, but it still segfaults whenever I try to draw to the screen.