Löve2D with C?

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
Abello966
Prole
Posts: 2
Joined: Thu May 23, 2013 10:38 am

Löve2D with C?

Post 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?
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Löve2D with C?

Post by bartbes »

It's possible I guess, though love is c++. That said, I very much doubt your assignment allows for this..
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Löve2D with C?

Post 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.
When I write def I mean function.
User avatar
Hexenhammer
Party member
Posts: 175
Joined: Sun Feb 17, 2013 8:19 am

Re: Löve2D with C?

Post 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.
Abello966
Prole
Posts: 2
Joined: Thu May 23, 2013 10:38 am

Re: Löve2D with C?

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

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 2 guests