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 / Tier 2 : app::Loop

Author
Message
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 16th Aug 2011 20:17
Why is this code not working?

It is not executing the first WHILE loop and app is totally stuck.

Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 16th Aug 2011 20:47 Edited at: 16th Aug 2011 20:47
This is because you need to allow app::Loop to be called on a continual basis in order to perform any tasks behind the scenes, whereas in this instance it's getting stuck in the while loop.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 16th Aug 2011 21:55
Quote: "Why is this code not working?"


Think of app::Loop() as the code needed to draw a single frame, and your game loop is the continual calling of this function by the device.

The device will not update any of its input callbacks whilst it is in your Loop() function.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 17th Aug 2011 11:25
Ok got the concept now.

Can I exit an app:Loop and have multiple app:loops functions one after the other? or can i only have 1 app:loop in 1 prog?
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 17th Aug 2011 11:43
You can only have one app::Loop in your project.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 17th Aug 2011 12:05
I almost got the program flow to where i want it to go using CASE.

One last thing:

Can I exit from app:Loop using some command and terminate program?
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 19th Aug 2011 02:34
Check out the apps\interpreter source code which shows how to quit based on the platform you are in. As you can see, I created a common app::ForceQuit function so my interpreter.cpp was 100% interchangeable between all the different T2 IDEs.

I drink tea, and in my spare time I write software.

Login to post a reply

Server time is: 2024-03-29 15:45:07
Your offset time is: 2024-03-29 15:45:07