[fpc-pascal] Calling function pointer to main program
Ryan Joseph
genericptr at gmail.com
Thu Jan 2 22:57:48 CET 2020
> On Jan 2, 2020, at 2:51 PM, Sven Barth via fpc-pascal <fpc-pascal at lists.freepascal.org> wrote:
>
> What exactly are you trying to accomplish on which platform with which version?
>
I'm making an iOS platform layer in the style of SDL which needs to use iOS's main loop which never returns until the program stops execution. Within the iOS callbacks I need to then callback into the programs main begin..end block so the user can establish their own event loop (which then uses threads to synch between the 2 event loops).
I've got the SDL source code but I'm not understanding how they get control back to the user even using the -XM flag. They have a function:
extern C_LINKAGE int SDL_main(int argc, char *argv[]);
which they call from within the iOS event loop and that calls the programs main functions which was defined using -XMSDL_main
Sorry if that doesn't make sense but I barely understand the problem myself.
Regards,
Ryan Joseph
More information about the fpc-pascal
mailing list