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

Handling Error #3768 on IOS #23

Open
idanasher opened this issue Sep 21, 2016 · 3 comments
Open

Handling Error #3768 on IOS #23

idanasher opened this issue Sep 21, 2016 · 3 comments

Comments

@idanasher
Copy link

First of all - I am using the DMT already for my android game- works great !! loving it !
Thanks a lot Gil (and XTDStudios) for your continued efforts...

I am performing testing on ipad\iphone devicesnow before launching my game
and I have this problem
whenever a DMT instance is still processing graphics - I exit the app (background).
this always results on this error:

Error: Error #3768: The Stage3D API may not be used during background execution on this operating system.
at ConcreteRectangleTexture/uploadBitmapData()[/Users/redge/Dropbox/Development/starling-2/starling/src/starling/textures/ConcreteRectangleTexture.as:38]
at starling.textures::Texture$/fromBitmapData()[/Users/redge/Dropbox/Development/starling-2/starling/src/starling/textures/Texture.as:321]
at com.xtdstudios.DMT.starlingConverter::StarlingConverter/init()[C:\Client\Flash\Libraries\PkamaLib\V_6_STAR\com\xtdstudios\DMT\starlingConverter\StarlingConverter.as:75]
at com.xtdstudios.DMT::DMTBasic/processTextures()[C:\Client\Flash\Libraries\PkamaLib\V_6_STAR\com\xtdstudios\DMT\DMTBasic.as:119]
at com.xtdstudios.DMT::DMTAbsAPI/onTexturesReady()[C:\Client\Flash\Libraries\PkamaLib\V_6_STAR\com\xtdstudios\DMT\DMTAbsAPI.as:274]
at com.xtdstudios.DMT::DMTAbsAPI/onGenerateComplete()[C:\Client\Flash\Libraries\PkamaLib\V_6_STAR\com\xtdstudios\DMT\DMTAbsAPI.as:269]
at com.xtdstudios.DMT::DMTAbsAPI/onGenerateComplete()

The DMT tries to render textures while app is in background.

But I have notice this:
on StarlingConverter.init function - you have this Try & Catch:
.....
catch (e:Error)
{
// we will ignore any error in case the context was diposed when creating the textures
// the context should be re-created anyways.
if (Starling.context && Starling.context.driverInfo != "Disposed")
throw e;
}

As I see it, in order to ignore this scenario as well, we should check the 'Starling.current.isStarted' result as well, thus resulting in this:

if (Starling.context && Starling.context.driverInfo != "Disposed" && Starling.current.isStarted)

In this way, we will avoid having this error thrown in this case.
we can also check this condition before 'Texture.fromBitmapData' ....

In addition, I have found out that it is wise, on the 'dmtComplete' event to check weather your app is active\deactivate.
and if it is suspended (on background) then I handle this manully... and continue the flow of generating graphics and using the dmt's created assets.

This bug has troubled me a lot lately, and I hope this sharing will help resolving this for others as well.

@gilamran
Copy link
Collaborator

It would be great if you could create a pull request will all the implementation that you mentioned so others will also benefit from it.
Thanks for the contribution!

@idanasher
Copy link
Author

ok, but I can't seem to understand what to choose here in order to submit
the pull request:

On Wed, Sep 21, 2016 at 12:23 PM, Gil Amran [email protected]
wrote:

It would be great if you could create a pull request will all the
implementation that you mentioned so others will also benefit from it.
Thanks for the contribution!


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#23 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHz2HUQFoHNM9xhRlo_5GLSjrvfyudygks5qsPeggaJpZM4KCkyk
.

@gilamran
Copy link
Collaborator

  • Click the "Fork" button on the top - right, to create a personal copy of DMT (Under your user)
  • Clone your new fork (It will have a different git url)
  • Do the code change, and push
  • Go to your repository on github, and github will (Automagically) offer your to create a pull request out of your changes back to the original DMT repository.

feel free to ask if it's not clear

thanks

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