ImGui LÖVE module

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
EntranceJew
Prole
Posts: 31
Joined: Fri Apr 03, 2015 10:02 pm
Location: Saint Petersburg, Florida
Contact:

Re: ImGui löve module

Post 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.
sandsmas: A LÖVE Editor
My Libraries: Imgur, Palettes, Music Macros, Timer, Hooks
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: ImGui löve module

Post 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.
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
asmageddon
Prole
Posts: 13
Joined: Mon Apr 09, 2012 1:39 pm

Re: ImGui löve module

Post 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.
User avatar
zorg
Party member
Posts: 3435
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: ImGui löve module

Post 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.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
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,

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!
asmageddon
Prole
Posts: 13
Joined: Mon Apr 09, 2012 1:39 pm

Re: ImGui löve module

Post 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.
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 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!
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 »

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
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 »

Yep that's part of the plan, as soon as I can I'll setup a github project!
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post 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?
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests