ImGui LÖVE module

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

Nixola wrote:I'm now getting this error (which I got before the one above, but somehow I didn't get it afterwards until now):

Code: Select all

libraries/imgui/imgui_impl.cpp: In function ‘bool Init()’:
libraries/imgui/imgui_impl.cpp:214:8: error: ‘window’ was not declared in this scope
  (void)window;
        ^~~~~~
libraries/imgui/imgui_impl.cpp:214:8: note: suggested alternative:
In file included from libraries/imgui/imgui_impl.cpp:11:0:
./modules/window/Window.h:35:11: note:   ‘love::window’
 namespace window
           ^~~~~~
Erf sorry for that, I changed something for the WIN32 part and totally missed to update it for the others, just try to comment this line and it should be OK. I've updated the git repo with these modifications if you want.
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

OK I've made the modifications on how enums are handled, it now uses string as you suggested and it's a lot cleaner!
Here's an example:

Code: Select all

imgui.SetNextWindowPos(50, 50, "FirstUseEver")
imgui.Begin("Another Window", true, { "AlwaysAutoResize", "NoTitleBar" })
So we can use a single string or a table of strings if we want to combine flags!
Next step will be to test on my side on Linux and then I'll make a try with the pull request to the love repo, but I need to go back to other tasks for now... I'll let you know how it goes!
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: ImGui löve module

Post by Positive07 »

If someone has free time or wants to take on a project I propose the challenge of writing a GUI library that uses the very same API as ImGui but is Lua/LÖVE only, instead of working with a separate backend in C/C++ it would be directly embeded in LÖVE.

The API of ImGui is really nice and so is the looks, so if someone did this then it would be a pretty big achievment! Dropping a dependency on a binary library and providing a great UI library in pure Lua would be awesome.

I'm against putting this inside of LÖVE, I think it's a really high level stuff, and I don't think it fits LÖVE's politics of doing just what is needed. Also there aren't that many UI heavy games mades for LÖVE and adding a pointless dependency for such projects is well pointless... Also I think that UI can already be done with Lua and LÖVE, that is why I proposed the challenge. Currently I'm on a BIG project so can't tackle it sorry
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
Jack5500
Party member
Posts: 148
Joined: Wed Dec 07, 2011 8:38 pm
Location: Hamburg, Germany

Re: ImGui löve module

Post by Jack5500 »

Well, I'm all for integrating a "proper" GUI library like ImGui into Löve. I think it's an area where Löve is really lacking. Sure you can roll your own for simple stuff, but what's the point of reinventing the wheel if you want to have more complex controls? A game framework should assist you with the repetitve work, just like it provides you a physics solution to work with so you don't have to roll your own. And as for the dependency: ImGui is small and self-contained (from my understanding) and is properly long-term supported by funding via patreon. So that shouldn't be a real problem.
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

Just tested on Linux and it's building and working without problems with the version currently in the git repo:

Image

Image

I won't be able to test on other platforms as they are not available to me, but I can probably make a pull request with this initial version and see how it's received.

Next improvements would be to add bindings for image widgets and custom fonts support, but I'll definitely won't have time for it, so I'll rely on contributions for these.
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

Hey guys,

So I made my try with the pull request and well, the bad news is that an UI module is out of LÖVE scope for an integration. But the good news is that I was totally unaware that it was possible to create binary modules loaded at runtime by the engine. So I updated the project to make it totally independent from LÖVE sources, there's no need anymore of a modified LÖVE version, it should work with the latest release or a nightly build.

I've updated the github project and added pre-build versions in the release section, so to test it you just need to copy the module (.dll or .so) in your executable folder or the LÖVE application folder (for instance "C:\Users\<user>\AppData\Roaming\LOVE" on Windows or ~/.local/shared/love on Linux), and just "require imgui" to get it loaded and ready to use.

If by any chance someone would be able to provide me with a MacOSX version, I would appreciate a lot!

EDIT: I've just updated it to be able to load the module from the LÖVE executable folder too, not just the application data folder.
EDIT2: And yes I just tested and it works with the 0.10.1 release.
Last edited by Fenrir on Mon Jul 25, 2016 11:28 am, edited 3 times in total.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: ImGui löve module

Post by Nixola »

Honestly, I was wondering why you didn't do that earlier. That's some good news! ^^
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

Nixola wrote:Honestly, I was wondering why you didn't do that earlier. That's some good news! ^^
I totally missed this feature... :shock: I thought that the only way of loading a binary module was through ffi but there's a proper plugin system implemented into love.filesystem.
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: ImGui löve module

Post by airstruck »

Fenrir wrote:but there's a proper plugin system implemented into love.filesystem.
Is that plugin system documented anywhere? Is there any reason the usual thing won't work instead (put a "foo.so" or "foo.dll" somewhere in require path with a "luaopen_foo" entrypoint function)?
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: ImGui löve module

Post by Positive07 »

That is totally what he means. This "plugin system" he mentions is just the Lua standard way of requiring binary libraries.

Though most probably he was doing this statically and now he can do it dynamically that is why it was necessary to modify LÖVE in the first place and now a dll is needed.
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 6 guests