Page 7 of 17

Re: ImGui löve module

Posted: Thu Aug 11, 2016 9:39 am
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.

Re: ImGui löve module

Posted: Thu Aug 11, 2016 9:48 am
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

Re: ImGui löve module

Posted: Thu Aug 11, 2016 9:57 am
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]);
	
	...

Re: ImGui löve module

Posted: Thu Aug 11, 2016 9:58 am
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 :)

Re: ImGui löve module

Posted: Thu Aug 11, 2016 10:04 am
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.

Re: ImGui löve module

Posted: Thu Aug 11, 2016 10:17 am
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]);
	
	...

Re: ImGui löve module

Posted: Thu Aug 11, 2016 10:18 am
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.

Re: ImGui löve module

Posted: Thu Aug 11, 2016 10:30 am
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?

Re: ImGui löve module

Posted: Thu Aug 11, 2016 10:41 am
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).

Re: ImGui löve module

Posted: Thu Aug 11, 2016 10:48 am
by Jack5500
Good guess, that was the case.
Maybe you could add the 32bit text to the release? That would be nice