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.

Newcomers AppGameKit Corner / Does AGK Basic support function pointers?

Author
Message
Eqqman
4
Years of Service
User Offline
Joined: 15th Jul 2015
Location:
Posted: 30th Jul 2015 22:46
I'd like to write a UI function to be called every loop that returns a function pointer to the UI event that should be executed. This would be pretty trivial in C++, but can I do the same in AppGameKit Basic?

Goo Goo G'Joob!
BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st Jul 2015 12:32
Not at the moment unfortunately.
I'd like to see it in the future. They added it to DarkBASIC Professional so the code may be there to be implemented again.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Eqqman
4
Years of Service
User Offline
Joined: 15th Jul 2015
Location:
Posted: 1st Aug 2015 07:46
I see, thank you.

Goo Goo G'Joob!
janbo
10
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 1st Aug 2015 21:44
Hey,

this is the third request I saw in a short time for function pointers.
If there is such a high demand, maybe it'll implemented really.

Is there a place where we can vote for AppGameKit features?
Except the Features Request thread...


Using AGKv2 Tier1
Ancient Lady
Valued Member
15
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Aug 2015 01:12
Eqqman, if you are comfortable in C++, go with it.

It allows the full use of Object Oriented Programming and so much more control.

I now need to find the time to finish up a Tier 2 tutorial that shows off many things good in Tier 2 and how to handle stuff. I think this will become one of my targets for time on weekends.

And, it only takes a few lines in files to be able to use the same code file set for multiple platforms.

template.h:


template.cpp:


The above gives peeks into using a state machine for handling processes.

In Tier 2, while the agk::sync() call might update displays anywhere in the code, there is only one place that it updates user inputs (touches and stuff). And that is in the app::Loop method, and it will only do so once for each call.

Cheers,
Ancient Lady

Login to post a reply

Server time is: 2019-07-23 10:13:15
Your offset time is: 2019-07-23 10:13:15