Page 1 of 1
How can i add my own LUA Functions using C into the LÖVE Api?
Posted: Tue Jan 17, 2023 11:13 pm
by iangel
Recently i've been experimenting Lua in C and i wanna know if is there a way to implement Lua functions into the LÖVE Api.
Re: How can i add my own LUA Functions using C into the LÖVE Api?
Posted: Wed Jan 18, 2023 8:15 am
by darkfrei
Re: How can i add my own LUA Functions using C into the LÖVE Api?
Posted: Wed Jan 18, 2023 11:15 am
by ivan
The LÖVE API is not written in Lua so no you cannot modify its functions without rebuilding LÖVE.
You can use FFI to call C functions exported from binary or DLL files.
Please note that FFI cannot create instances of C++ objects so the DLL functionality must use C not C++.
Re: How can i add my own LUA Functions using C into the LÖVE Api?
Posted: Wed Jan 18, 2023 8:18 pm
by iangel
ivan wrote: ↑Wed Jan 18, 2023 11:15 am
You can use FFI to call C functions exported from binary or DLL files.
Please note that FFI cannot create instances of C++ objects so the DLL functionality must use C not C++.
I see now, thanks ivan i'll check if it's possible to do it