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 / How do you exit from app::Loop

Author
Message
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 25th Aug 2011 02:40
how do you go to the app end or exit from the app::Loop()

i tried
app::End();
but the app does not end;

void app::End ( void )

Go through yourself at a wall.
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 25th Aug 2011 03:18
how do you go to the app end or exit from the app::Loop()

i tried
End();
but the app does not end;
it goes to app::End() where I clean up a few things but the program still runs in end.

void app::End ( void )

Go through yourself at a wall.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 25th Aug 2011 03:41
The mobile devices normally wait for a home button press to signal the end of an app. On Windows you can force an exit by using the PostQuitMessage(0); command.
LiamGoodacre
13
Years of Service
User Offline
Joined: 25th Aug 2011
Location:
Posted: 25th Aug 2011 23:30
I couldn't find the ability to do it, so I added it in myself...

Within my app class, I added private var 'running' and the methods: 'Terminate' and 'IsRunning',


Within Core.mm I modified the loop condition...
From:


To:


Then when I wish to exit, I just call Terminate on my App


Hope this helps,
Liam Goodacre
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 1st Sep 2011 02:30
Hi,

Also if you look at the apps\interpreter source (Tier 2 C++), you will see I have an AppForceQuit call in coreforapp.h which services me very well to keeping platform specific code away from the main CPP file of my app. Adding to the core.cpp is also fine, but I find I like to keep my core.cpp generic so I can move it from one Windows project to another.

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

Login to post a reply

Server time is: 2024-11-21 17:51:35
Your offset time is: 2024-11-21 17:51:35