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 to properly quit an app in tier 2

Author
Message
Thestroyer
8
Years of Service
User Offline
Joined: 14th May 2016
Location:
Posted: 14th May 2016 10:44
I am making an app in tier 2, but i dont know how to properly quit an app (so the deconstructors and such are getting called).
My app is in fullscreen, so you can't just click on the red cross of the app.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th May 2016 16:22
The best way would be to modify app::Loop() to return an integer, then check this return value in Core.cpp and break out of the message loop when you want to quit. Then you just have to return the chosen value from app::Loop().
Thestroyer
8
Years of Service
User Offline
Joined: 14th May 2016
Location:
Posted: 15th May 2016 15:37
Thank you, Paul

It took some time to figure out, cause im not really experienced with c++, but I have done what you said. For people other people who want to know how to exit an app in tier 2 here is the part of core.cpp i edited at line 735:

if (!agk::IsCapturingImage()) {
if (App.Loop() == 0) {
bExitLoop = true;
}
}

Login to post a reply

Server time is: 2024-11-25 08:42:54
Your offset time is: 2024-11-25 08:42:54