Running LÖVE from C++

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
rbxkools
Prole
Posts: 5
Joined: Thu Mar 28, 2013 9:45 pm

Running LÖVE from C++

Post 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:
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Running LÖVE from C++

Post by raidho36 »

IIRC, since 0.9.0, you can link LÖVE as a library.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Running LÖVE from C++

Post by kikito »

You read the C++ source code, understand it, and then integrate it in your program :)
When I write def I mean function.
User avatar
CaptainMaelstrom
Party member
Posts: 163
Joined: Sat Jan 05, 2013 10:38 pm

Re: Running LÖVE from C++

Post 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.
Post Reply

Who is online

Users browsing this forum: Google [Bot], Iori Branford and 6 guests