Port ngage to header-only SDL_main + SDL_RunApp()

For some reason, ngage doesn't seem to be handled in any of the
build systems, so I couldn't add SDL_ngage_runapp.cpp to any buildscript
This commit is contained in:
Daniel Gibson 2022-12-12 18:30:05 +01:00 committed by Sam Lantinga
parent 7bfc41db3c
commit 544f2c7982
4 changed files with 109 additions and 79 deletions

View file

@ -156,7 +156,22 @@ int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
}
/* end of WinRT impl */
#elif defined(__IOS__) || defined(__TVOS__) || defined(__3DS__)
#elif defined(__NGAGE__)
/* same typedef as in ngage SDKs e32def.h */
typedef signed int TInt;
/* TODO: if it turns out that this only works when built as C++,
move __NGAGE__ into the C++ section in SDL_main.h */
TInt E32Main()
{
return SDL_RunApp(0, NULL, SDL_main, NULL);
}
/* end of __NGAGE__ impl */
/* TODO: remaining platforms */
#else /* platforms that use a standard main() and just call SDL_RunApp(), like iOS and 3DS */
#include <SDL3/begin_code.h>
@ -175,9 +190,7 @@ int main(int argc, char *argv[])
#include <SDL3/close_code.h>
/* end of __IOS__, __3DS__, __TVOS__ impls */
/* TODO: remaining platforms */
/* end of impls for standard-conforming platforms */
#endif /* __WIN32__ etc */