Pages: 1
  Print  
Author Topic: Cross-Platform External DLL Functions Now Supported  (Read 24284 times)
Offline (Unknown gender) time-killer-games
Posted on: May 03, 2020, 03:22:16 pm
"Guest"


Email
Hey guys!

Robert fixed our Windows functions for calling DLL's so that they can use strings correctly. I decided to add to this vast improvement by making these functions work on Mac OS X, Linux, and FreeBSD. Mac is still broken so it's not tested on there, but there's no reason why it wouldn't work, once the Cocoa and Mac SDL platforms get patched.

Functions introduced by this extension:
- external_define(dll, name, calltype, restype, argnumb, argtype[0], argtype[1], ...argtype[10])
- external_call(id, args[0...15])
- external_free(id)

Example project demonstrating the use of external functions:
https://enigma-dev.org/edc/games.php?game=111

Example DLL source code:
https://github.com/time-killer-games/DialogModule

This means nearly all GameMaker extensions for Desktop Platforms should now work in ENIGMA out-of-the-box, whether for GameMaker Studio or older versions of GameMaker. Although you will need to set a compatibility mode for the version of GM your extension is built for in order to get window_handle() working. The only thing to be done is to convert your extension to use scripts with the external functions because we don't support GameMaker's special extension package formats yet. Due to POSIX and/or X11 compliance, a lot of Linux and Mac OS X extensions can be rebuilt and "just work" on FreeBSD in a lot of cases if you have the source code handy.

To get access to these new features, simply update enigma to the latest version and enable the "External Functions" extension like so:



You will also need to install libffi. Windows users should already have this installed because we've included it on our Windows Installation page for a long time now. As for everyone else, the dependency can be installed for your platform using the terminal commands below...

Ubuntu/Debian-Linux based:
Code: [Select]
sudo apt-get install libffi-dev
Arch/Manjaro-Linux based:
Code: [Select]
sudo pacman -Sy libffi
FreeBSD-based:
Code: [Select]
sudo pkg ins libffi
Have a wonderful day.
Samuel
« Last Edit: May 03, 2020, 03:39:59 pm by time-killer-games » Logged
Pages: 1
  Print