Page 1 of 1
How can I write C++ code in Love
Posted: Fri Jul 20, 2012 3:33 pm
by dedeus
Hello everyone
!
I'd like to know, if is possible write a C++ code in Love?
Regards!
Re: How can I write C++ code in Love
Posted: Fri Jul 20, 2012 4:26 pm
by josefnpat
dedeus wrote:Hello everyone
!
I'd like to know, if is possible write a C++ code in Love?
Regards!
If you are new to löve, no.
If you are a veteran to löve, then there is less "no".
You could:
- Remove the Lua usage from the löve codebase, and re-write the API calls in c++, and then recompile it, or just compile it as a project and use löve as a library. (People don't do this)
- Find or write a c++ interpreter written in Lua. (People definitely don't do this)
Re: How can I write C++ code in Love
Posted: Fri Jul 20, 2012 6:42 pm
by pavanetti
Re: How can I write C++ code in Love
Posted: Fri Jul 20, 2012 6:48 pm
by pavanetti
There is a other way to access C code in Lua.
There is a lua library called Alien. This lib has functions to access native code in dynamic libraries(*.dll/*.so).
http://alien.luaforge.net/
Re: How can I write C++ code in Love
Posted: Sat Jul 21, 2012 3:26 am
by zwzsg
How can I write C++ code in Love
You're doing it wrong.
The whole point of Löve is to avoid the hassle of going the lenghty, confusing and bug prone way of the C++.
Instead of C++, with Löve you write your code in Lua, which is much easier and safe and simple than C++, thus allowing to produce in days what would take months.
If you don't like Lua and insist of programming your application in C++, then there are a tons of C++ libraries out there aiming at providing interfaces like Löve but for C++.
If you already knew that but still need to add a touch of C++ to a big Lua project, then use
package.loadlib