-
Notifications
You must be signed in to change notification settings - Fork 43
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
Android, lost/restore context #1
Comments
Hi, there are more problems with mobile targets then CONTEXT_LOST :( I think that CONTEXT_LOST problem is in OpenFL, not in BabylonHx (its
In html5 it runs really nice and I have updated the code (not publised Still a lot of work remains though ... Regards, On Tue, Feb 18, 2014 at 1:37 PM, Laurent Bédubourg <notifications@github.com
|
"context lost events for Android when using OpenGLView (other platforms retain the GL context during a resize) and other audio fixes." I think it means: "I send you the event, now that's your problem" :) I tried to add an event listener on the stage and I indeed received these events (twice by the way). I know that starling has something similar for android (http://forum.starling-framework.org/topic/new-feature-handling-a-lost-device-context). I imagine we have to reset all cache and resent textures and data to the GPU? |
Sorry, wrong button :) I'll ask joshua to know exactly what we should expect. |
Got a reply, it looks like an openfl problem, thank you for your time:
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
|
I am afraid Joshua did not understand my question. In fact the application must listen to the CONTEXT_RESTORED event (on OpenGLView) and has to be able to recreate its buffers, shaders, etc. I don't know how much work it represents for BabylonHX but it seems pretty mandatory for Android. |
I don't think it should be considered as an openFL problem. In my implementation, im not using openfl.Assets at all, just like Laurent stated , starling textures are calling a callback, so you can reload all the textures back. I think there should be a way to load the data to Textures. |
Well, it shouldn't be considered as BabylonHx problem neither because it exists on every application that uses OpenGLView - try "HerokuShaders" and "SimpleOpenGLView" OpenFl samples. |
Fixed in 2.0 |
Hello, I am testing BabylonHx and it's working quite well on html5, congrats !
I have a problem on Android, when the device is rotated or the application put in the background the opengl context is lost.
openfl sends openfl.display.OpenGLView.CONTEXT_LOST and openfl.display.OpenGLView.CONTEXT_RESTORED events (flash.Lib.current.stage)
Is something planed to automatically restore the context?
If not what do you think is the best way to efficiently restore it by hand?
Thanks,
Laurent
The text was updated successfully, but these errors were encountered: