mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-08-29 01:51:37 +00:00
Changed main callback return values to an enumeration
Fixes https://github.com/libsdl-org/SDL/issues/10515
This commit is contained in:
@@ -39,13 +39,13 @@ static void SDLCALL MainCallbackRateHintChanged(void *userdata, const char *name
|
||||
|
||||
int SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit)
|
||||
{
|
||||
int rc = SDL_InitMainCallbacks(argc, argv, appinit, appiter, appevent, appquit);
|
||||
SDL_AppResult rc = SDL_InitMainCallbacks(argc, argv, appinit, appiter, appevent, appquit);
|
||||
if (rc == 0) {
|
||||
SDL_AddHintCallback(SDL_HINT_MAIN_CALLBACK_RATE, MainCallbackRateHintChanged, NULL);
|
||||
|
||||
Uint64 next_iteration = callback_rate_increment ? (SDL_GetTicksNS() + callback_rate_increment) : 0;
|
||||
|
||||
while ((rc = SDL_IterateMainCallbacks(SDL_TRUE)) == 0) {
|
||||
while ((rc = SDL_IterateMainCallbacks(SDL_TRUE)) == SDL_APP_CONTINUE) {
|
||||
// !!! FIXME: this can be made more complicated if we decide to
|
||||
// !!! FIXME: optionally hand off callback responsibility to the
|
||||
// !!! FIXME: video subsystem (for example, if Wayland has a
|
||||
@@ -77,7 +77,7 @@ int SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit,
|
||||
}
|
||||
SDL_QuitMainCallbacks();
|
||||
|
||||
return (rc < 0) ? 1 : 0;
|
||||
return (rc == SDL_APP_FAILURE) ? 1 : 0;
|
||||
}
|
||||
|
||||
#endif // !SDL_PLATFORM_IOS
|
||||
|
||||
Reference in New Issue
Block a user