GFFI
Filed under: Game Maker
GFFI – Game Maker Foreign Function Interface
GFFI is a dll that allows you to call functions from other dlls.
It is much more flexible than external_call, supporting
all the basic data types in C, as well as providing advanced features for
working with structs and arrays. There are no restrictions on the
number of string arguments (or any other argument type for that matter)
other than Game Maker’s 16 argument limit (this can be worked around
in future if the need is there). The functionality provided is similar
to Python’s ctypes module and .NET’s P/Invoke system.
The speed should be comparable to external_call. There is slightly more overhead
due to the dynamic nature of the code, which uses transparent type conversion
and intelligent assembly code. Through the use of Gmapi, all the
functions available for use are inserted as a builtin GM function. There is no
interpreted code involved once you call a GFFI function. Nearly all the scripts
provided are placeholders to avoid syntax errors, they also contain documentation.
I hope people find this DLL useful, I used it as an opportunity to learn some C
(and then hastily tacked on a C++ library).
I’ve included a few basic examples of usage – it’s perfect for making a few
WinAPI calls without writing an ad-hoc wrapper dll.
Update: I released this just before GM8 came out. I just added support for GM8 as well.
