SDL3 - any reason to prefer main or callbacks

In a game I’m working on I have made some poor design decisions. The scripts can do certain actions that could take multiple frames to complete but during this time most things should still run as normal and when that’s done it should continue running the original script from where it left off. The way I have implemented this is basically by running the main loop recursively inside the scripts.

Example
actor.say("Hello!"); // pushes a text game state that will not get popped until the user press Enter. Events still need to be handled as normal for things like window resizing and keyboard shortcuts to still work, and to feed the key presses to the text state to allow it to detect the Enter press. This is why the game loop needs to run inside the this function.
actor.turn(left); // just change the state of the actor and continue immediately 
wait(5); // will run the game for 5 frames before continuing...
...

I admit that this is not the best way to do it, and it has certain consequences, but I have spent a lot of time to make it work satisfactory so redesigning it now when the game is almost complete would just be a lot of extra work for very little gain so I don’t think it’s worth it.

This approach is of course totally incompatible with the SDL3 callback approach so when I decide it’s time to upgrade to SDL3 I won’t use the callbacks.


If I started a new game using SDL3, I don’t know which approach I would pick. I’m leaning towards the classic main function approach, because that’s what I’m used to and it means I won’t need to pass objects using globals or void pointers, but if there are advantages that I haven’t thought about I might consider it. It seems like the callbacks might help making window resizing look more responsive on some platforms but I’m not sure if it actually works better than the event watcher workaround. It’s also a bit unclear to me if and how the callbacks are meant to handle frame pacing. If I write the code myself it’s more obvious what is going on and easier to adjust. In any case, I would definitely try to stay away from having “recursive main loops” which should make switching approach much easier.