Page 1 of 1

liblove and external access.

Posted: Fri Jul 12, 2013 2:50 pm
by Calin Leafshade
Hi there!

I'm developing an adventure game engine using love2d as the backend (It's called Adore (Adventure Rendering Engine). Cute right?) I'd like to access love's API from within a host application and hopefully display its output within my editor application. The goal being to create a "live" environment for display of stuff being edited.

I noticed that in the dev branch of love it's possible to compile it to a library. Does this allow me to initialise the graphics separately and maybe capture the output so i can display it within my host? That *seems* to be the purpose of the library but I can't find any documentation (understandable due to the unreleased nature of the feature)

Re: liblove and external access.

Posted: Sat Jul 13, 2013 9:21 am
by bartbes
Well, you can do that with the executable, too. Take a look at http://www.libsdl.org/docs/html/sdlenvvars.html (specifically SDL_WINDOWID).

Re: liblove and external access.

Posted: Sat Jul 13, 2013 6:09 pm
by Calin Leafshade
How would I control the viewport though? Surely if i set the SDL window to my host window it will either stretch to the window or just render it at 0,0 relative to the windows client area.

Really I want to direct the output to a control rather than an entire window.

Re: liblove and external access.

Posted: Sat Jul 13, 2013 6:25 pm
by bartbes
I know most toolkits allow for something like a "subwindow".
That said, if you're not afraid to get your hands (really) dirty, you might be able to somehow feed love.graphics an opengl context.

Re: liblove and external access.

Posted: Sat Jul 13, 2013 6:29 pm
by Calin Leafshade
bartbes wrote:That said, if you're not afraid to get your hands (really) dirty, you might be able to somehow feed love.graphics an opengl context.
This was my plan B but part of my brief was to keep Adore compatible with stock love if possible.

From looking at the source it does seem like there is some effort to make love less standalone and able to integrate with a host application. i.e the seperation of the screen code and the option to compile to a library rather than an executable.

Re: liblove and external access.

Posted: Sun Jul 14, 2013 7:14 pm
by T-Bone
If all else fails, you could use luasocket to communicate between your application and a LÖVE game.