I just tried to omit the SDL_Init() function, but everything is still working. By everything I mean the audio and graphics. Does this mean this function is useless?
Also, I’m getting a runtime error when I close the program:
“This application has requested the Runtime to terminate it in an unusual way. Please contact the application’s support team for more information”
What can be causing this? I’m closing everything properly:
SDL_FreeSurface(Screen);
SDL_FreeSurface(Message);
Mix_FreeMusic(mus2);
TTF_CloseFont(Font);
TTF_Quit();
SDL_Quit();
These are the only surfaces/fonts/music im using:
//The surfaces
TTF_Font *Font = NULL;
SDL_Surface *Screen = NULL;
SDL_Surface *Message = NULL;
Mix_Music *mus2 = Mix_LoadMUS("./music.mp3");
If the entire source code is required then ask!
Edit:
The error was due to me trying to free the Screen surface!
The error was due to me trying to free the Screen surface, which is actually a task that SDL_Quit() does. I dont know why I was doing it 😛