Page 1 of 1

Running LÖVE from C++

Posted: Mon Oct 14, 2013 1:27 pm
by rbxkools
I've recently embedded some lua into a C++ program. And it successfully compiled! After hours of searching and clicking I fixed all the problems that it had. But now, the excitement has gone away and I was thinking about how LÖVE fits into all of this.

To take it a step further, now that I have gotten lua to run from C++, how do I make LÖVE run my game from C++.

Just for the fun of it? :ultraglee:

Re: Running LÖVE from C++

Posted: Mon Oct 14, 2013 2:00 pm
by raidho36
IIRC, since 0.9.0, you can link LÖVE as a library.

Re: Running LÖVE from C++

Posted: Mon Oct 14, 2013 2:03 pm
by kikito
You read the C++ source code, understand it, and then integrate it in your program :)

Re: Running LÖVE from C++

Posted: Tue Oct 22, 2013 2:08 am
by CaptainMaelstrom
I've been diving into some of this myself lately.

Something interesting from the PiL:
This ability to be used as a library to extend an application is what makes
Lua an extension language. At the same time, a program that uses Lua can
register new functions in the Lua environment; such functions are implemented
in C (or another language), so that they can add facilities that cannot be written
directly in Lua. This is what makes Lua an extensible language.
These two views of Lua (as an extension language and as an extensible
language) correspond to two kinds of interaction between C and Lua. In the
rst kind, C has the control and Lua is the library. The C code in this kind
of interaction is what we call application code. In the second kind, Lua has
the control and C is the library. Here, the C code is called library code.
From this, you may be, as I am, more interested in registering C functions from inside a Lua (or LOVE2D) program. I haven't actually tried it, but it shouldn't be too hard, as Lua was designed for extensibility in mind. Cheers.