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

Why isn't SOKOL_NO_ENTRY supported on android? Is it impossible or just not implemented yet? #1015

Open
creikey opened this issue Mar 22, 2024 · 1 comment

Comments

@creikey
Copy link

creikey commented Mar 22, 2024

Trying to decide between SOKOL_NO_ENTRY and linking to a DLL that has sokol functions from JAI, or figuring out how to somehow link to sokol in such a way that I define sokol_main and the header has the entry point. I'd like to do no entry but if that means no android then that's bad.

@floooh
Copy link
Owner

floooh commented Mar 22, 2024

IIRC mainly because the Android entry code looks and works completely different then all other platforms.

Most importantly, Android doesn't have the C main function, but instead ANativeActivity_onCreate is the entry point, and ANativeActivity is entirely event based, so the sokol_app.h implementation of ANativeActivity_onCreate creates a thread and then hands off control to that thread (and the original main thread is dispatching events.

I guess one solution would be to move the code in ANativeActivity_onCreate into an _sapp_android_run() function and then when SOKOL_NO_ENTRY is defined not create our own ANativeActivity_onCreate, but instead depend on the user to build the Android-specific startup code, but I'm not sure how that could be hooked up to JAIs entry function.

Did you already solve the problem of hooking up ANativeActivity with JAI's entry point somehow? In that case we can experiment with the idea outlined above.

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

No branches or pull requests

2 participants