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 / GetResumed() Tier 1 v1089

Author
Message
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 8th Apr 2013 01:31
Hello, I am having an issue with GetResumed() and I was wondering if this is a bug or as designed. It would be easier just to illustrate the issue. In the below snippet, GetResumed() works fine, i.e. the FPS print straight from loading and the 'Resumed' is displayed only after the window regains focus:



Now, by adding a Sync() prior to the loop, GetResumed() returns 1 when the app initially starts, and therefore starts with the 'Resumed' displayed, like so:



This is causing a problem for me as I need to perform a Sync() to load in my LoadingScreen (I don't like to use AGKSplash.png), and my Pause menu is initiated immediately... Any ideas? Thank you!
Grumpy Jedi
14
Years of Service
User Offline
Joined: 16th Jan 2010
Location:
Posted: 8th Apr 2013 02:07 Edited at: 8th Apr 2013 02:08
You could skip the GetResumed() part of your code for the first sync.

Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 8th Apr 2013 11:48
Hello Grumpy Jedi, unfortunately I've tried that and it doesn't work. Having done a bit more digging, it appears that if you have a sync before the loop, GetResumed() will remain '1' until you call the function.

I definitely think this is a bug, but a simple work around would be to add the below after the Sync. This seems to refresh GetResumed(), and from then, it works as expected.



I'll add this to the bug board, if I can explain it haha...
Grumpy Jedi
14
Years of Service
User Offline
Joined: 16th Jan 2010
Location:
Posted: 8th Apr 2013 12:25 Edited at: 8th Apr 2013 12:28
Ah I see, you're saying GetResumed() is returning 1 before the main loop because you're using a sync() for the startup routine.

Why don't you just add a while loop before the main loop to pause until GetResumed() returns 0 like so.




EDIT: oh nevermind you came up with your own solution it looks like
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 8th Apr 2013 14:09
Yeah, it seems to be ok with my workaround... Thanks all the same!!

Login to post a reply

Server time is: 2024-05-04 17:24:48
Your offset time is: 2024-05-04 17:24:48