SDL_Event e;
SDL_AudioDeviceID dev;
while (SDL_PollEvent(&e)) {
- if (e.type == SDL_QUIT) {
+ if (e.type == SDL_QUIT || e.key.keysym.sym == 0) {
done = 1;
} else if (e.type == SDL_KEYUP) {
if (e.key.keysym.sym == SDLK_ESCAPE)
iteration();
}
#endif
-
int
main(int argc, char *argv[])
{
if (argc > 1) {
SDL_strlcpy(filename, argv[1], sizeof(filename));
} else {
- SDL_strlcpy(filename, "sample.wav", sizeof(filename));
+ SDL_strlcpy(filename, "./res/sample.wav", sizeof(filename));
}
/* Load the wave file into memory */
if (SDL_LoadWAV(filename, &spec, &sound, &soundlen) == NULL) {