-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
SDL2 backend doesn't support a loading screen #465
Labels
Comments
Things tried:
Concerning 2., the idea was to reverse the order: first create SDL context, then unpack and start the app. This require few changes to the SDL activity in order to make it right. Nevertheless, SDL (unlike its SDL iOS port) doesn't seem to have a proper way to achieve loading screen. I'll try a third way, which is to add another widget in top of the SDL surface, containing the bitmap. |
tito
added a commit
to tito/python-for-android
that referenced
this issue
Jan 15, 2016
As explained on kivy#465, the previous approach (pure GL, or using window background) doesn't fully work. This approach have a tiny delay until PythonActivity.onCreate is called. It first display an ImageView fitted on the screen. Once SDL is loaded (and that SDL put its own layout), we put again our ImageView. The tricky part is when to remove. On the previous python-for-android+kivy, kivy was explicitely saying that he's ready to receive event. And that's where we knew the loading screen could be removed. Here, there is no absolute way to do it, as SDL itself on the java part doesn't provide any callback... except pollInputDevices() This method is called each X seconds, to check if any joystick has been plugged or not. The PR add a keepActive() method that is overrided in PythonActivity to remove the screen. It wait for the second call of it before removing the loading screen: 1. the first call is done right after the creation of the SDL window in C code. (In kivy, it's just the start, after that we load the app, widgets etc... it can take a long time) 2. the second call is done (at least on kivy) after the first frame rendered. The loading screen might be displayed more than needed (pure SDL2 game // very fast loading). In any case, we can always force to remove the loading screen with: PythonActivity.mActivity.removeLoadingScreen() If anybody have another good approach, feel free :) Closes kivy#465
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The SDL2 backend doesn't support an icon splash screen like the pygame one.
This should be quite easy to add and might be an easy first contribution.
I'd like this to be more configurable than the old pygame one, particularly giving an option for a different image on the first run. SDL2 loads faster than pygame so some apps may be better off having no splash screen on later runs, as it actually makes things feel slower.
The text was updated successfully, but these errors were encountered: