Renamed SDL events for clarity

Fixes https://github.com/libsdl-org/SDL/issues/6877
This commit is contained in:
Sam Lantinga
2023-01-23 17:54:09 -08:00
parent 74697bc351
commit 7b50bae524
101 changed files with 1375 additions and 862 deletions

View File

@@ -84,13 +84,13 @@ iteration()
SDL_Event e;
SDL_AudioDeviceID dev;
while (SDL_PollEvent(&e)) {
if (e.type == SDL_QUIT) {
if (e.type == SDL_EVENT_QUIT) {
done = 1;
} else if (e.type == SDL_KEYUP) {
} else if (e.type == SDL_EVENT_KEY_UP) {
if (e.key.keysym.sym == SDLK_ESCAPE) {
done = 1;
}
} else if (e.type == SDL_AUDIODEVICEADDED) {
} else if (e.type == SDL_EVENT_AUDIO_DEVICE_ADDED) {
int index = e.adevice.which;
int iscapture = e.adevice.iscapture;
const char *name = SDL_GetAudioDeviceName(index, iscapture);
@@ -113,7 +113,7 @@ iteration()
SDL_PlayAudioDevice(dev);
}
}
} else if (e.type == SDL_AUDIODEVICEREMOVED) {
} else if (e.type == SDL_EVENT_AUDIO_DEVICE_REMOVED) {
dev = (SDL_AudioDeviceID)e.adevice.which;
SDL_Log("%s device %u removed.\n", devtypestr(e.adevice.iscapture), (unsigned int)dev);
SDL_CloseAudioDevice(dev);