Page 4 of 17

Re: ImGui löve module

Posted: Sun Jul 17, 2016 12:05 pm
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.

Re: ImGui löve module

Posted: Tue Jul 19, 2016 2:32 pm
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!

Re: ImGui löve module

Posted: Tue Jul 19, 2016 8:22 pm
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

Re: ImGui löve module

Posted: Wed Jul 20, 2016 5:48 am
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.

Re: ImGui löve module

Posted: Wed Jul 20, 2016 10:00 am
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.

Re: ImGui löve module

Posted: Mon Jul 25, 2016 9:34 am
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.

Re: ImGui löve module

Posted: Mon Jul 25, 2016 9:40 am
by Nixola
Honestly, I was wondering why you didn't do that earlier. That's some good news! ^^

Re: ImGui löve module

Posted: Mon Jul 25, 2016 9:45 am
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.

Re: ImGui löve module

Posted: Mon Jul 25, 2016 6:30 pm
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)?

Re: ImGui löve module

Posted: Tue Jul 26, 2016 1:22 am
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.