I understand that SDL2 raises SDL_QUIT
and SDL_WINDOWEVENT_CLOSE
events (and use the former to break the app's render loop), but I don't understand how handling either event provides the ability to prevent the underlying window from closing (e.g. for user confirmation of exit).
Do I need to handle this per-platform?
To prevent the window from closing and application from terminating, you simply do nothing on receiving SDL_QUIT
and SDL_WINDOWEVENT_CLOSE
.