-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow use of main instead of android_main #508
Conversation
Inspired by raysan5#504. Instead of requiring the user to do PLATFORM_ANDROID #ifdefery, have the android_main entry point exported by raylib and call the user-defined main. This way many games could (in theory) run unmodified on Android and elsewhere. This is untested!
/* TODO should we maybe report != 0 return codes somewhere? */ | ||
(void)main(1, (char*[]){ arg0, NULL }); | ||
} | ||
/* TODO add this to header, if apps really need it) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do they need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, user doesn't need it, android app lifecycle is managed internally by raylib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
android_native_app_glue.h has more info about that structure.
Just waiting to get some time to test this change properly when merging... I'm closing academic term this week and I'm a bit busy for long implementation/testing sessions... |
Merged. Need to test it properly. |
Amazing! It works like a charm! :D |
With the recent CMake cleanup, getting raylib's dependencies for use when building rlgl_standalone is quite straight forward, so lets enable it again. Fixes raysan5#508, just properly this time. :)
With the recent CMake cleanup, getting raylib's dependencies for use when building rlgl_standalone is quite straight forward, so lets enable it again. Fixes raysan5#508, just properly this time. :)
With the recent CMake cleanup, getting raylib's dependencies for use when building rlgl_standalone is quite straight forward, so lets enable it again. Fixes raysan5#508, just properly this time. :)
With the recent CMake cleanup, getting raylib's dependencies for use when building rlgl_standalone is quite straight forward, so lets enable it again. Fixes raysan5#508, just properly this time. :)
Inspired by #504.
Instead of requiring the user to do
PLATFORM_ANDROID
#ifdef
ery,have the
android_main
entry point exported by raylib and callthe user-defined
main
. This way many games could (in theory)run unmodified on Android.
This is untested!