How can I write C++ code in Love

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
dedeus
Prole
Posts: 1
Joined: Fri Jul 20, 2012 3:21 pm

How can I write C++ code in Love

Post by dedeus »

Hello everyone :cool: !

I'd like to know, if is possible write a C++ code in Love?

Regards!
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: How can I write C++ code in Love

Post by josefnpat »

dedeus wrote:Hello everyone :cool: !

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:
  1. 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)
  2. Find or write a c++ interpreter written in Lua. (People definitely don't do this)
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
User avatar
pavanetti
Prole
Posts: 5
Joined: Thu Aug 04, 2011 6:15 pm

Re: How can I write C++ code in Love

Post by pavanetti »

Last edited by pavanetti on Wed Aug 01, 2012 9:17 pm, edited 1 time in total.
User avatar
pavanetti
Prole
Posts: 5
Joined: Thu Aug 04, 2011 6:15 pm

Re: How can I write C++ code in Love

Post 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/
User avatar
zwzsg
Prole
Posts: 14
Joined: Thu Jul 19, 2012 9:44 pm

Re: How can I write C++ code in Love

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

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 40 guests