Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Issues with Snapshots resuming on Android
Started by playthisstudios Nov 07 2013 02:52 PM

5 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

playthisstudios

[GLOBAL: userInfoPane.html]
playthisstudios
  • Enthusiast

  • 71 posts
  • Corona SDK

Things are going well with our current project using Graphics 2.0, but we are looking to ship on Android and at the moment, it seems like there is an issue with resuming an application and having snapshots corrupted in the display.

 

Is this something that Corona is actively looking at? More than happy to work through more detailed examples, but for the moment, any snapshot displayed will be corrupted upon resuming.



[TOPIC: post.html]
#2

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

Can you try adding a system event listener, and on the "applicationResume", call "snapshot:invalidate()"? 



[TOPIC: post.html]
#3

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

Also, if you are using the "discard" mode, you will not be able to recover your texture b/c the GPU is allowed to lose that data between a suspend/resume cycle.



[TOPIC: post.html]
#4

playthisstudios

[GLOBAL: userInfoPane.html]
playthisstudios
  • Enthusiast

  • 71 posts
  • Corona SDK

Hi Walter,

 

Was planning on getting a simple example together, but you beat me to it. Using the discard mode is exactly what we are doing (painting masks onto multiple layers (snapshots) ).

 

Can you think of any way around this? This would be a big problem if this is lost during resume.

 

Thanks

 

David

 



[TOPIC: post.html]
#5

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

Do you really need discard mode?

 

You can still use the canvas group either way. And the advantage of not using discard mode is that your previous edits are "saved" to the master snapshot.group, so when you call invalidate(), you can regenerate the texture upon a resume via snapshot:invalidate().



[TOPIC: post.html]
#6

playthisstudios

[GLOBAL: userInfoPane.html]
playthisstudios
  • Enthusiast

  • 71 posts
  • Corona SDK

I'll try your suggestion later today and let you know how it goes! Btw, does iOS work differently for this, because we have no issues on that platform?

 




[topic_controls]
[/topic_controls]