ImGui LÖVE module

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Ortimh
Citizen
Posts: 90
Joined: Tue Sep 09, 2014 5:07 am
Location: Indonesia

Re: ImGui löve module

Post by Ortimh »

Amazing! Definitely using this. By the way where do I find the documentation of ImGui? I'm trying to read imgui.h in ImGui repository but it's hard to understand when and where should I use the functions.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: ImGui löve module

Post by s-ol »

Ortimh wrote:Amazing! Definitely using this. By the way where do I find the documentation of ImGui? I'm trying to read imgui.h in ImGui repository but it's hard to understand when and where should I use the functions.
Read some of the references: https://github.com/ocornut/imgui#references

There's a 'programmer's guide' in imgui.cpp: https://github.com/ocornut/imgui/blob/m ... ui.cpp#L77

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
Ortimh
Citizen
Posts: 90
Joined: Tue Sep 09, 2014 5:07 am
Location: Indonesia

Re: ImGui löve module

Post by Ortimh »

s-ol wrote:Read some of the references: https://github.com/ocornut/imgui#references

There's a 'programmer's guide' in imgui.cpp: https://github.com/ocornut/imgui/blob/m ... ui.cpp#L77
Thanks, that shortens my trouble.

I have another question, why does the example create a "Debug" window while it doesn't create one?

Code: Select all

	...
	
	-- Menu
	if imgui.BeginMainMenuBar() then
		if imgui.BeginMenu("File") then
			imgui.MenuItem("Test")
			imgui.EndMenu()
		end
		imgui.EndMainMenuBar()
	end

	-- Debug window - Eh?
	imgui.Text("Hello, world!");
	status, clearColor[1], clearColor[2], clearColor[3] = imgui.ColorEdit3("Clear color", clearColor[1], clearColor[2], clearColor[3]);
	
	...
User avatar
AnRu
Citizen
Posts: 69
Joined: Sun Oct 27, 2013 1:33 pm
Contact:

Re: ImGui löve module

Post by AnRu »

Fenrir wrote:
AnRu wrote: Okay, i rewrite it :)
Is there a way to use it with modified version of imgui from another authors?
Well I found this version adding the docks from LumixEngine:
https://github.com/adcox/imgui
Should not be too much work to add it to this module, as it seems to be encapsulated into separated files without modifications to imgui itself. I can have a look at it as soon as I have some time, as I must admit than even for my editor it could be quite useful. :)
That will be great :)
Last edited by AnRu on Thu Aug 11, 2016 10:27 am, edited 1 time in total.
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

Ortimh wrote:Amazing! Definitely using this. By the way where do I find the documentation of ImGui? I'm trying to read imgui.h in ImGui repository but it's hard to understand when and where should I use the functions.
Well my main source of doc is the imgui.h file, once you understand the general concept of the lib, you don't need anything more.

Then on my github page (https://github.com/slages/love-imgui) you have a general usage example, showing when to call NewFrame, Render, ShutDown and the inputs methods, and also showing the main differences between the C++ API and the lua one:

- Tables like float[2], float[3], ImVec2, ImVec4 are "flattened".
- Pointer values meant to be modified are returned with the new value.
- Values for combos or plotlines are just lua tables.
- Flags are passed as strings or table of strings to combine multiple flags.
User avatar
Ortimh
Citizen
Posts: 90
Joined: Tue Sep 09, 2014 5:07 am
Location: Indonesia

Re: ImGui löve module

Post by Ortimh »

Fenrir wrote:
Ortimh wrote:Amazing! Definitely using this. By the way where do I find the documentation of ImGui? I'm trying to read imgui.h in ImGui repository but it's hard to understand when and where should I use the functions.
Well my main source of doc is the imgui.h file, once you understand the general concept of the lib, you don't need anything more.

Then on my github page (https://github.com/slages/love-imgui) you have a general usage example, showing when to call NewFrame, Render, ShutDown and the inputs methods, and also showing the main differences between the C++ API and the lua one:

- Tables like float[2], float[3], ImVec2, ImVec4 are "flattened".
- Pointer values meant to be modified are returned with the new value.
- Values for combos or plotlines are just lua tables.
- Flags are passed as strings or table of strings to combine multiple flags.
Thanks for the pointers. But uhm..
Ortimh wrote:I have another question, why does the example create a "Debug" window while it doesn't create one?

Code: Select all

	...
	
	-- Menu
	if imgui.BeginMainMenuBar() then
		if imgui.BeginMenu("File") then
			imgui.MenuItem("Test")
			imgui.EndMenu()
		end
		imgui.EndMainMenuBar()
	end

	-- Debug window - Eh?
	imgui.Text("Hello, world!");
	status, clearColor[1], clearColor[2], clearColor[3] = imgui.ColorEdit3("Clear color", clearColor[1], clearColor[2], clearColor[3]);
	
	...
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

Ortimh wrote:
s-ol wrote:Read some of the references: https://github.com/ocornut/imgui#references

There's a 'programmer's guide' in imgui.cpp: https://github.com/ocornut/imgui/blob/m ... ui.cpp#L77
Thanks, that shortens my trouble.

I have another question, why does the example create a "Debug" window while it doesn't create one?

Code: Select all

	...
	
	-- Menu
	if imgui.BeginMainMenuBar() then
		if imgui.BeginMenu("File") then
			imgui.MenuItem("Test")
			imgui.EndMenu()
		end
		imgui.EndMainMenuBar()
	end

	-- Debug window - Eh?
	imgui.Text("Hello, world!");
	status, clearColor[1], clearColor[2], clearColor[3] = imgui.ColorEdit3("Clear color", clearColor[1], clearColor[2], clearColor[3]);
	
	...
By default, all elements not specifically contained into a window are created into the "debug" window. So it can be convenient if in your code you just want some debug outputs and create imgui.Text() elements (or any other ones) dispatched in it, you'll find them all regrouped in the debug window. But for instance on my side I'm not using it, I always encapsulate my widgets into defined windows, so the default debug window doesn't appear.
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 »

Mhm, the Windows DLL doesn't work for me. The love windows crashes instantly when I use the example with the 0.4 dll.
Might just be me, but can someone verify? Also, is there way to catch the error log or something similar?
User avatar
Fenrir
Party member
Posts: 222
Joined: Wed Nov 27, 2013 9:44 am
Contact:

Re: ImGui löve module

Post by Fenrir »

Jack5500 wrote:Mhm, the Windows DLL doesn't work for me. The love windows crashes instantly when I use the example with the 0.4 dll.
Might just be me, but can someone verify? Also, is there way to catch the error log or something similar?
It's currently built in 32bit, so be sure to use a 32bit version of LOVE (10.0.1).
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 »

Good guess, that was the case.
Maybe you could add the 32bit text to the release? That would be nice
Post Reply

Who is online

Users browsing this forum: RagingDave and 3 guests