Thank you,
Onyx
void HandleEvents()
{
switch (event.type) {
case SDL_KEYDOWN:
switch (event.key.keysym.sym) {
case SDLK_q:
printf("Bye Bye!\n");
SDL_FreeSurface(sprite);
exit(0);
case SDLK_SPACE:
break;
default:
break;
}
case SDL_QUIT:
printf("Bye Bye!\n");
SDL_FreeSurface(sprite);
exit(0);
default:
break;
}
} Oh and event is a global variable as is sprite, so it is there.P.S. I added the SDLK_SPACE because it kept exiting, as for now it seems if I use return; instead of break it works.
UPDATE: After further testing, it seems that all nonexplicitly defined keystrokes cause this to occur.












