Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / BUG: Draw functions no longer work after resume

Author
Message
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 19th Feb 2015 22:34
In my app, I continually draw lines and have text display over the top of the drawing. If the app is placed in the background, the text continues to display, but the draw functions no longer work.

I have tried using GetResumed() and attempting to re-initialize the app but nothing seems to work.

I'm using setrendertoscreen () and createsprite(1,1) to leave the lines that have been drawn while I draw new lines.


Any ideas appreciated.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Feb 2015 11:41
Do you have any sample code, I can test here on a Nexus 4 and a cheap Android tablet.

Quidquid latine dictum sit, altum sonatur
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 21st Feb 2015 00:53 Edited at: 21st Feb 2015 00:57
I have 8 different Android devices that I use to test and they all exhibit this problem. This happens both when I make an apk and test it or when I am broadcasting to the device for test.

If I jump to another app, without closing my app, then return to my app, it returns as a black screen and the draw commands don't work.

Here is some sample code

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 21st Feb 2015 11:27 Edited at: 21st Feb 2015 11:30
And the winner for the most messed up, unexplainable mess in the smallest amount of code goes to....

As far as I can see, you've done everything right, but the results are bizarre

I ran your code and got the same result - no output after resuming. I added the timer output as a print statement to prove it was still ticking over.

Then I removed the render to image, so you get a rapid display of random boxes on a black background. Except my background wasn't black. It looked like a crashed screen in the old days of DOS, where you just got a heap of garbage. But the boxes kept flashing.
I resumed several times, with all sorts of results. The first time I got a black screen. Then I got it working as it should, for about 3 seconds before stopping again. A couple more resumes and it worked as expected. Then it went back to being unstable again.

More interesting with the render direct to screen was that after resume, the clock was a mirror image in the bottom left, instead of top-right. When I ended the program, the AppGameKit player wait screen was also mirrored top to bottom! But the power button was still operating in the top right.

I recreated and eliminated some issues in odd ways and with no immediately apparent logic.

1. By creating render image 1 and removing all of the draw commands (e.g just a blank screen), I got the garbage background. If I changed the image number to 99, I got the expected black background

2. If I changed the image number to 99 in your demo, I still got the garbage background (I also let it assign its own ID with the same results)

3. If I remove the render to image commands but create the render image, and not use it I get the garbage background

4. If I remove the render to image commands and the render image I get the expected black background


It looks like you need to report this as a bug, as it's happening on several devices.

Quidquid latine dictum sit, altum sonatur
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 21st Feb 2015 21:33 Edited at: 21st Feb 2015 21:35
Where do I report a bug? I've looked but couldn't easily find it.

Also, I tried the code example that is given for "SetRenderToImage" under "Help" and it has the same problem. Except that it locks up my phone.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 22nd Feb 2015 20:49
The latest release thread is the place to post any bugs you find. Paul monitors this thread for issues.

Quidquid latine dictum sit, altum sonatur
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 10th Mar 2015 18:06
Looks like a problem with the way Android restores its images after a resume, rendered images aren't being restored properly and become permanently blank. I'll see if I can fix it for the next version.
JRNTexas
13
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 11th Mar 2015 07:53
@Paul....Thank you!
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 18th Jun 2015 23:24
This is still a problem in 2.0.14

I was testing breaking out of my app into a webpage, and on returning the renderToImage() sprites were gone.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 18th Jun 2015 23:56

Login to post a reply

Server time is: 2024-11-25 21:59:27
Your offset time is: 2024-11-25 21:59:27