How can i add my own LUA Functions using C into the LÖVE Api?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
iangel
Prole
Posts: 2
Joined: Fri Sep 02, 2022 5:47 pm

How can i add my own LUA Functions using C into the LÖVE Api?

Post 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.
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: How can i add my own LUA Functions using C into the LÖVE Api?

Post 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++.
User avatar
iangel
Prole
Posts: 2
Joined: Fri Sep 02, 2022 5:47 pm

Re: How can i add my own LUA Functions using C into the LÖVE Api?

Post 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 :ultraglee:
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 6 guests