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 / [Plugins] Memblocks?

Author
Message
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 7th Dec 2017 22:19
Can plugins access memblocks yet?
I saw an old locked thread where it was implied it might be added in a future/next version.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 8th Dec 2017 11:03
yes it was added, use GetMemBlockPtr()
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 9th Dec 2017 14:38
Any examples or docs?
I can't find any reference to it...
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 18th Dec 2017 12:52
unsigned char* memblockPointer = agk::GetMemblockPtr( memblockID );
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 19th Dec 2017 00:05
Tier 2 only?
What about from 3rd party language?

Do I need to make use of the AGKReceive?
puzzler2018
User Banned
Posted: 19th Dec 2017 00:15
Which s that 3rd party?

Cause AppGameKit is run on C - then C dlls work


C# is different to C++ as much as Delphi is different to Python, oooh and there is Pascal - who on earth was he

All completely different platforms


What you writing your app on?



puzzler2018
User Banned
Posted: 19th Dec 2017 00:19
Did you know that Microsoft Windows was written in Assemly and C just a bit of background history
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 19th Dec 2017 22:37
Quote: "unsigned char* memblockPointer = agk::GetMemblockPtr( memblockID );
"

Looks like a c# or tier 2 reference (agk:

I am using delphi so wondered how I would get the reference without using agk:: / tier 2

I am assuming that the ReceiveAGKPtr() reference which I currently set to nil (because that was the only thing that worked otherwise) is needed to reference AppGameKit functions from delphi.

My Delphi ReceiveAGKPtr() function.



nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 30th Jan 2020 21:33
Returning to this as I need to be able to send a fair bit of data back to AppGameKit from a plugin.

Either being able to pass a memblock or array pointer to my DLL so I can write stuff to it. Any ideas?
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 11th Feb 2020 19:34
ReceiveAGKPtr(*Ptr) << it receives a pointer to an AppGameKit internal function that gets a pointer to an AppGameKit API function, lets call this "GetAGKFunction" and you use this to get a pointer to a function like so: *Ptr = GetAGKFunction("CREATESTRING_S_L")

I dont know how it would look in delphi but in PureBasic I import the functions as C Prototypes, that looks like this:



I'v attached my complete plugin wrapper, maybe you can write a script to convert it

Attachments

Login to view attachments
nz0
AGK Developer
16
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 20th Feb 2020 00:09
Thanks for the response. Maybe it helps a bit, but I'll still be poking around in the dark here.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 20th Feb 2020 20:28
You need to use function pointers

Maybe in delphi it would look something like (from a quick search)

Login to post a reply

Server time is: 2024-04-23 20:02:39
Your offset time is: 2024-04-23 20:02:39