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 / Is v10811 too efficient?

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Apr 2013 20:46
I'm having an issue with display levels in v10811 that doesn't exist for the same code in v1076.

So, I put in some breaks so that I could see where the issue was popping up.

Because there are a lot of physics used during game play, I check GetResumed() at the start of my main loop. If it is triggered, and the app is in game play mode, it puts the game in paused mode.

Apparently, any user action that takes the focus away from the app will trigger GetResumed when the app gets the focus back.

This is not the behavior in v1076.

So, when the debugger kicks in, and then you restart, GetResumed triggers.

Since the event I'm trying to catch is when the background depth gets changed, and the code that pauses the game raises it, this sort of makes it impossible to debug. And it would interfere with any other sort of debugging as well.

Now, if the app actually paused (like it sort of does in iOS and Android) when focus was lost, this might be sort of understandable.

But the app keeps on running (and the player keeps on moving and bumping into things). So the game pause doesn't work.

But the main issue in this post is that, if you catch GetResumed, during debug, your process flow gets messed up (unless you are trying to debug the app behavior when GetResumed returns 1).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Apr 2013 23:31
some help i use is a global debug variable or struct, i fill it
and show it in main loop with print.
also you can make a virtual breakpoint with a flag and
a while wend loop and waiting for a key press.
or if it hard to debug i wrote a log file and read it.

skipping the Resume because Pause logic.
function GetResumedX()
// ret=GetResumed()
endfucntion ret
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 26th Apr 2013 23:34
I had to code in two calls to GetResumed() to get it to work properly for me, what I did is just discard the first call.
Maybe some hodge-podge method like that will work for you?

I do wish there was a command to detect the window losing focus...

www.NaplandGames.com
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th Apr 2013 18:41
I suppose I could simply comment out the line while trying to test this basic thing.

But, if a Windows app is going to have a response to GetResumed, it should probably also have a LostFocus so that the app can pause itself. Or, the app should pause when it looses focus.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 27th Apr 2013 18:43
Agreed! But I don't think I want it to always pause. I could see some tools I might make with AppGameKit that I'd run in the background, but then again I may be better off making those in DBPro.
Definitely need to be able to tell when it loses focus. I don't care if it is a Windows only command!

www.NaplandGames.com

Login to post a reply

Server time is: 2024-05-02 03:02:51
Your offset time is: 2024-05-02 03:02:51