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?
Running LÖVE from C++
Re: Running LÖVE from C++
IIRC, since 0.9.0, you can link LÖVE as a library.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Running LÖVE from C++
You read the C++ source code, understand it, and then integrate it in your program
When I write def I mean function.
- CaptainMaelstrom
- Party member
- Posts: 163
- Joined: Sat Jan 05, 2013 10:38 pm
Re: Running LÖVE from C++
I've been diving into some of this myself lately.
Something interesting from the PiL:
Something interesting from the PiL:
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.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.
Who is online
Users browsing this forum: Google [Bot] and 2 guests