Page 1 of 1
Löve2D with C?
Posted: Thu May 23, 2013 10:53 am
by Abello966
Hello everyone.
I'm a CS student on my first year and my next class project is to code in C a steganography program to hide text in a pgm image. I decided I wanted to take it a little further and turn it on a fully functional program. The idea would be to write an graphic interface with Lua/LÖVE2D. The only thing I'm not sure is, is it possible or functional? Could I write a C program which calls a Lua script that uses löve?
Re: Löve2D with C?
Posted: Thu May 23, 2013 11:01 am
by bartbes
It's possible I guess, though love is c++. That said, I very much doubt your assignment allows for this..
Re: Löve2D with C?
Posted: Thu May 23, 2013 12:15 pm
by kikito
You could do the opposite: a love program that calls C functions. You would have to wrap the C functions into Lua-callable functions/objects. It would not be easy, I don't recommend it for an assignment - do it in your free time instead.
Re: Löve2D with C?
Posted: Thu May 23, 2013 12:20 pm
by Hexenhammer
Abello966 wrote:Hello everyone.
I'm a CS student on my first year and my next class project is to code in C a steganography program to hide text in a pgm image. I decided I wanted to take it a little further and turn it on a fully functional program. The idea would be to write an graphic interface with Lua/LÖVE2D. The only thing I'm not sure is, is it possible or functional? Could I write a C program which calls a Lua script that uses löve?
It should be the other way around if your GUI is in LÖVE. You simply write your text hiding program as a console app and then call it from the LÖVE GUI using os.execute().
Making sure that your C program works without the LÖVE GUI also makes sure that you don't get into trouble for not fulfilling the requirements of your assignment.
A more advanced solution would be to write a text hiding library in C and integrate it into LÖVE (you can link a C lib with a C++ app). That way you could build the whole thing as one coherent program. And you could still write a small console app in C using said library to fulfill the requirement of handing in a pure C program.
Re: Löve2D with C?
Posted: Thu May 23, 2013 5:03 pm
by Abello966
Thank you, guys.
Yes, the idea was never to hand the project with LÖVE to my teacher, just write the pure C program and turn it in, then later build a visual interface to integrate it, in my spare time
What I am going to do then is write all the functions I'll need in C and call them from a Lua/LÖVE2D program.