Skip to content
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

Merged
merged 1 commit into from
Apr 2, 2018
Merged

Conversation

a3f
Copy link
Contributor

@a3f a3f commented Mar 16, 2018

Inspired by #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.

This is untested!

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) */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do they need it?

Copy link
Owner

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.

Copy link
Owner

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.

@raysan5
Copy link
Owner

raysan5 commented Mar 19, 2018

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...

@raysan5 raysan5 merged commit e72b96a into raysan5:master Apr 2, 2018
@raysan5
Copy link
Owner

raysan5 commented Apr 2, 2018

Merged. Need to test it properly.

@raysan5
Copy link
Owner

raysan5 commented Apr 2, 2018

Amazing! It works like a charm! :D

a3f added a commit to a3f/raylib that referenced this pull request Jul 29, 2018
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. :)
a3f added a commit to a3f/raylib that referenced this pull request Jul 29, 2018
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. :)
a3f added a commit to a3f/raylib that referenced this pull request Jul 29, 2018
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. :)
a3f added a commit to a3f/raylib that referenced this pull request Jul 29, 2018
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. :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants