Page 2 of 17

Re: ImGui löve module

Posted: Thu Jul 07, 2016 9:11 pm
by EntranceJew
You'll never guess who my new favorite person is! (It's you. How about that.)

This totally rules and it's been something I've been dying for for a while but I wasn't skilled enough to even get it out of the gate.
I would totally be in favor of this shipping as an official love module, once all the kinda rough C parts are rounded off (like the global ImGuiSetCond_FirstUseEver leaking into lua-space). It could also use a bit more love-like API but it's still pretty rad that you got it this far.

Re: ImGui löve module

Posted: Fri Jul 08, 2016 2:48 pm
by vrld
Sorry for hijacking the thread to promote my libraries, but SUIT is a pure Lua imgui library. ocornut's imgui lib offers way more widgets than SUIT does. However, most (all?) of the traditional widgets can be implemented using just a few the basic imgui building blocks: buttons, sliders, and inputs. You can even implement moveable, stackable windows with these.

Re: ImGui löve module

Posted: Sun Jul 10, 2016 12:33 pm
by asmageddon
Ah, I love it. I'm a bit hesitant to use modified Love, though. Out of curiosity, have you submitted a pull request to Love devs? imgui is a stable, mature, simple, very efficient library, and I'd absolutely love to see it included in Love.

Re: ImGui löve module

Posted: Sun Jul 10, 2016 1:34 pm
by zorg
GUIs can be made a myriad ways.
Choosing one and stuffing it into Löve would go against its minimalistic framework-like design.
Don't take my word for it though.

Re: ImGui löve module

Posted: Mon Jul 11, 2016 7:47 am
by Fenrir
Hey guys,

Sorry I was off last week!
alloyed wrote:So I tried compiling it as an external lib on Linux, my notes so far:

imgui needs a prerelease copy of love. Love 0.10.2 is missing a function or two.

Compiling as a separate library that links to liblove compiles fine, though I'm not sure if it can share state with the actual love game yet. Right now, it segfaults when trying to call filesystem functions, which at least suggests that maybe it's not been initialized.

There were a few things that looked like errors that I edited to get it to compile:

GetColorU32 is exported by imgui_iterator.cpp, even though its an inline. Commenting it out fixed the problem

OPTIONAL_LABEL_ARG expects 2 arguments but is only defined as having one. Just add an extra arg to fix

EDIT: Figured out what was wrong, it just turns out my version of love-hg was a little outdated. I'll publish my fork on github in a bit once I figure out how I want to deal with getting header files from love
Thanks a lot man for trying it! As soon as I can I'll boot on linux and try it on my side!
vrld wrote:Sorry for hijacking the thread to promote my libraries, but SUIT is a pure Lua imgui library. ocornut's imgui lib offers way more widgets than SUIT does. However, most (all?) of the traditional widgets can be implemented using just a few the basic imgui building blocks: buttons, sliders, and inputs. You can even implement moveable, stackable windows with these.
Thanks for pointing it, I had a look at it before going for imgui but well, I was really looking for a library totally mature and fully featured to not make the same mistake than with LoveFrames. And I must admit than knowing personnally the imgui developper (he was one of my teachers at school) and knowing that he have support through patreon to continue to update and maintain the library makes me more confident than going again on a Lua based library without knowing if at some point it won't be dropped again.
asmageddon wrote:Ah, I love it. I'm a bit hesitant to use modified Love, though. Out of curiosity, have you submitted a pull request to Love devs? imgui is a stable, mature, simple, very efficient library, and I'd absolutely love to see it included in Love.
Thanks man, it's still not ready for an official pull request but I'll sure make one as soon as possible!
zorg wrote:GUIs can be made a myriad ways.
Choosing one and stuffing it into Löve would go against its minimalistic framework-like design.
Don't take my word for it though.
Well as I said imgui is a developper centric UI library, it won't suit for a game UI, but it can really help speed up a lot the development process, that's why I think it can really suit well into löve as a nice option for developpers to easily create tools for their games. And as lua-enet for instance it's totally optionnal, you can use a different option if you want.

Apart from that I started to migrate my editor to it:
Image

And it totally convinced me that it was the right thing to do, with a lot less code I'm able to do a lot more than with my previous solution, and it's working like a charm so far!

Re: ImGui löve module

Posted: Mon Jul 11, 2016 8:05 am
by asmageddon
As Fenrir said, imgui is very dev-centric - a lot can be built on top of it, and it's very flexible, while staying minimalistic. Its minimalist and lightweight nature are what makes me feel like it'd be a perfect fit for Love - if you want something fancier, you use a different lib, or build one on top of imgui. If you want something quick, or just really high performance, you go for imgui. I don't think it goes against love philosophy any more than including Box2D or enet does. It's a mature library that shouldn't add much maintenance overhead, I see few downsides to including it, and many upsides.

Re: ImGui löve module

Posted: Wed Jul 13, 2016 9:18 am
by Fenrir
OK I finished porting the in-game editor to imgui:
Image

It was quite fast to make the move, and it confirmed that with a lot less code than my previous implementation using loveframes, I'm having a more featured and robust tool. And more importantly, it will be a lot more easier to make it evolve from now.

While implementing everything, I improved a bit the imgui löve module, and I also integrated the changes alloyed pointed me to make it build on Linux, so as soon as I can I'll make some further tests on it and then I think it will be ready for a pull request. I'll let you know how it goes!

Re: ImGui löve module

Posted: Wed Jul 13, 2016 9:31 am
by Nixola
Fenrir, would you put this LÖVE "mod" on Github? I'd like to try it, and that way everyone would be able to improve it

Re: ImGui löve module

Posted: Wed Jul 13, 2016 9:38 am
by Fenrir
Yep that's part of the plan, as soon as I can I'll setup a github project!

Re: ImGui löve module

Posted: Wed Jul 13, 2016 9:42 am
by Fenrir
BTW, there's something I'm really not happy with, it's how imgui enums are handled, currently everything is exported using globals like:

Code: Select all

lua_pushnumber(L, ImGuiWindowFlags_NoTitleBar);
lua_setglobal(L, "ImGuiWindowFlags_NoTitleBar");
lua_pushnumber(L, ImGuiWindowFlags_NoResize);
lua_setglobal(L, "ImGuiWindowFlags_NoResize");
...
Is there any way to do it more elegantly without poluting the application globals list?