using SDL_delay instead of usleep