Page 8 of 17

Re: ImGui löve module

Posted: Thu Aug 11, 2016 11:00 am
by Fenrir
Jack5500 wrote:Good guess, that was the case.
Maybe you could add the 32bit text to the release? That would be nice
Good idea yes, I'll update it! :)

Re: ImGui löve module

Posted: Fri Aug 12, 2016 3:30 pm
by Fenrir
Hey guys,

So I added the extension for dockable windows and it works quite well:
Image

And it requires no modifications to imgui, it was just 2 files to add and create the corresponding bindings, so normally it won't prevent updating imgui to the latest versions in the future.

I updated the github project with a new release containg the docks and also the support for PlotLines and PlotHistogram widgets (quite useful for performance metrics). And I added an usage example of the docking capabilities in the github main page (it's the code creating what we can see on the gif).

Win32 and Linux builds are available for this v0.5 release, and of course I would be very grateful if someone can complete it with a MacOSX one! :)

Re: ImGui löve module

Posted: Fri Aug 12, 2016 3:48 pm
by Ortimh
Wow, thanks a lot. It's incredibly useful. By the way can I use Image from LOVE to ImGui's ImageButton?

Re: ImGui löve module

Posted: Fri Aug 12, 2016 3:57 pm
by Fenrir
Ortimh wrote:Wow, thanks a lot. It's incredibly useful. By the way can I use Image from LOVE to ImGui's ImageButton?
Nop that's one of the latest and biggest limitation of the current bindings, no support for images... It should not be too complex to add now that everything is relying on LOVE and not anymore on OpenGL or SDL calls, but I must admit that I have no use for it, so I won't be able to allocate time soon to work on it.

One possible workaround is just to retrieve a widget bounding box (with imgui.GetItemRectMin() and imgui.GetItemRectMax()), and render your image on top of it (so after the imgui.Render() call).

Re: ImGui löve module

Posted: Fri Aug 12, 2016 4:50 pm
by AnRu
Fenrir, thank you a lot for docking :)

Re: ImGui löve module

Posted: Sat Aug 13, 2016 4:01 pm
by AnRu
Is there a way to attach some love2d drawing stuff to window? For example i want to draw canvas over window, but i also need to do some interactions with it. So, events or something for windows?

Re: ImGui löve module

Posted: Mon Aug 15, 2016 7:46 am
by Ortimh
Well I have read the ImGui Lua binding.. and it doesn't support images. Such a disappointment. But ImGui surely is the best for debugging and such.
AnRu wrote:Is there a way to attach some love2d drawing stuff to window? For example i want to draw canvas over window, but i also need to do some interactions with it. So, events or something for windows?
I think there's no way to combine ImGui and LOVE drawing stuff. It's not possible.

Re: ImGui löve module

Posted: Mon Aug 15, 2016 7:51 am
by Jack5500
I would like to raise my voice for image support as well, but none the less: Great work Fenrir. Couldn't you "attach" the window by storing the coordinates of where you draw your windows?

Re: ImGui löve module

Posted: Mon Aug 15, 2016 12:03 pm
by Fenrir
AnRu wrote:Is there a way to attach some love2d drawing stuff to window? For example i want to draw canvas over window, but i also need to do some interactions with it. So, events or something for windows?
Ortimh wrote:Well I have read the ImGui Lua binding.. and it doesn't support images. Such a disappointment. But ImGui surely is the best for debugging and such.

I think there's no way to combine ImGui and LOVE drawing stuff. It's not possible.
Hehe it's definitely not impossible, it just requires a bit of work with some custom bindings for it, as IMGUI wants a texture ID when it wants to draw an Image or ImageButton, and then it sends back this ID when requesting to draw this image. The best way to handle it would be to bind this ID to a LOVE Texture object to be able to draw canvas or regular images, then in the love-imgui plugin store this Texture object and create a ID for IMGUI, and finally when drawing it, get back the correct Texture from the ID we get and attach it to the Mesh object used for rendering. I'll try to find some time to work on it this week but I can't promise! :)

About the events, there's nothing directly into IMGUI, but it's not too complex, the way to go would just to check if your rendering canvas is currently hovered (imgui.IsItemHovered()). If yes, you retrieve you mouse coords and transform them into the canvas space (by retrieving the Item position and size with imgui.GetItemRectMin() and imgui.GetItemRectMax()) and you should be good to go.

Re: ImGui löve module

Posted: Tue Aug 16, 2016 1:01 am
by LordSeaworth
Hmm this seems very interresting.
Going to keep my eyes on this.

Could use his in my project.