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 I exit a T2 App

Author
Message
Reactor
15
Years of Service
User Offline
Joined: 6th Apr 2009
Location:
Posted: 21st Dec 2011 17:03
Hi,

I have up to this point mainly used T1 in AppGameKit but I have recently started trying out T2 apps... (for Android using NDK/C++ in exclipse)

I a T1 App I could use the End() function to exit the app (for instance if an exit button was pressed)

In T2 this command does not seem to Exist (there is no agk::End() function found)

Since the app::Loop function is called on every sync loop, I cannot exit the loop programatically either (would of been great if a "exit" argument was passed to the function that I could set)

Any help in this regard would be greatly appreciated..

Thanks.

==================================================
you gotta live to survive to be a hundred and five
==================================================
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 21st Dec 2011 17:32
Check out the source code for the AppGameKit Player here: AGK\IDE\apps\interpreter

You will find a source file called CoreForApp.h

Inside here, look for the function: AppForceExit

You can cut and paste this function to exit the app across all platforms.

I drink tea, and in my spare time I write software.
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 1st Apr 2012 20:47 Edited at: 1st Apr 2012 21:22
I didn't find the code

EDIT: Oops, I found the code in another file. I am a little bit confused because there are two files with the same name but in different folders...


and

which I've include in my all projects so far...

By removing the FREEVERSION define, which is my case, then I am getting compilation errors

EDIT #1: OK, I've found the solution, I have to define the platform
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 1st Apr 2012 22:19
No, you don't need to define anything.

Just copy whole AppForceExit function from CoreForApp.h and make it a part of app class.

So, paste it and make it:



function.

Then just freely call it from your code.

george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 3rd Apr 2012 18:05
I did what you've suggested but the function does nothing, simply because nothing has been defined by the preprocessor (FREEVERSION, AGKWINDOWS etc.)
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 3rd Apr 2012 18:12
Uh. It is being defined when you run the application itself I think. I don't have any
anywhere and it runs fine.

george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 3rd Apr 2012 18:32 Edited at: 3rd Apr 2012 18:35
Quote: "It is being defined when you run the application itself I think"

The same thought, but it doesn't work for me
@kamac: Are you using the "MS Express"? Do you mind to search the entire solution for this: "AGKWINDOWS"

Thanks
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 4th Apr 2012 18:48
Quote: "The same thought, but it doesn't work for me
@kamac: Are you using the "MS Express"? Do you mind to search the entire solution for this: "AGKWINDOWS"

Thanks"


I did check around the solution, but there's no define for it.

george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 4th Apr 2012 22:17
OK, thanks a lot

Login to post a reply

Server time is: 2024-11-23 07:18:54
Your offset time is: 2024-11-23 07:18:54