Tests: Use the main callback code macros

This commit is contained in:
L zard 2024-05-27 17:31:55 +02:00 committed by Sam Lantinga
parent 7d81e9d46c
commit 06aa02453a
7 changed files with 68 additions and 64 deletions

View file

@ -22,6 +22,10 @@
/* Ported from original test/common.c file. */
#include <SDL3/SDL_test.h>
#define SDL_MAIN_NOIMPL
#define SDL_MAIN_USE_CALLBACKS
#include <SDL3/SDL_main.h>
static const char *common_usage[] = {
"[-h | --help]",
"[--trackmem]",
@ -2400,19 +2404,19 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event
}
break;
case SDLK_ESCAPE:
return 1;
return SDL_MAIN_CALLBACK_EXIT_SUCCESS;
default:
break;
}
break;
}
case SDL_EVENT_QUIT:
return 1;
return SDL_MAIN_CALLBACK_EXIT_SUCCESS;
default:
break;
}
return 0; /* keep going */
return SDL_MAIN_CALLBACK_CONTINUE;
}
void SDLTest_CommonEvent(SDLTest_CommonState *state, SDL_Event *event, int *done)