SDL2: implement support for loadingscreen#605
Merged
Conversation
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
inclement
added a commit
that referenced
this pull request
Jan 15, 2016
SDL2: implement support for loadingscreen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As explained on #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:
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:
If anybody have another good approach, feel free :)
Closes #465