Can you do like string matching?
For example, no GL enum values are in Löve, instead there are stuff like "dynamic" for GL_DYNAMIC_DRAW etc.
something like löve.imgui.setTitleBar(false) or löve.imgui.setProperty("title_bar", false) ?
ImGui LÖVE module
Re: ImGui löve module
It would be possible but it removes the ability to combine flags, or we would need to send a table of flags and it will be quite more tricky to handle. It would be best to keep using numbers if possible.
-
- Prole
- Posts: 13
- Joined: Mon Apr 09, 2012 1:39 pm
Re: ImGui löve module
I agree with Trebgarta. Handling flags as numbers, with OR, is a practice I absolutely abhor. There is very little reason to have it here, the added complexity isn't a big deal at all.
Re: ImGui löve module
OR, put them into a table in love.imgui or whatever. Then to combine one can use bitwise like in c/cpp. Though that isnt very idiomatic in Lua.
The Lua way would be strings. To combine flags one can pass in a table of strings. Bad and complicated but at least the API will be idiomatic and easier to use.
The Lua way would be strings. To combine flags one can pass in a table of strings. Bad and complicated but at least the API will be idiomatic and easier to use.
Re: ImGui löve module
Yep after thinking about it going for strings is probably the best option, with the ability to pass only one string if we're interested by only one flag or an array of strings if we want to set multiple flags.
I'll have a look into implementing it!
I'll have a look into implementing it!
Re: ImGui löve module
OK guys I've created a github project:
https://github.com/slages/love-imgui
Now I need to catch up on other tasks but I'll try to come back to it next week for the improvements to the enums management.
https://github.com/slages/love-imgui
Now I need to catch up on other tasks but I'll try to come back to it next week for the improvements to the enums management.
Re: ImGui löve module
I tried building in Linux, I get this error:
Code: Select all
libraries/imgui/imgui_iterator.cpp:10:15: error: expected constructor, destructor, or type conversion before ‘(’ token
IMGUI_FUNCTION(Render)
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: ImGui löve module
Hmm can you try converting the imgui_iterator file to a .h instead of a .cpp, and in warp_imgui_impl.cpp, make the switch to include the .h instead of a .cpp (lines 424 and 537).
It seems that the file is being built before being included where it needs to, and actually it's quite weird that this file is a .cpp and not a .h, I kept this behavior because it's how it was done in the project I used as base but it seems there's no real reason for it.
It seems that the file is being built before being included where it needs to, and actually it's quite weird that this file is a .cpp and not a .h, I kept this behavior because it's how it was done in the project I used as base but it seems there's no real reason for it.
Re: ImGui löve module
I'm now getting this error (which I got before the one above, but somehow I didn't get it afterwards until now):
Code: Select all
libraries/imgui/imgui_impl.cpp: In function ‘bool Init()’:
libraries/imgui/imgui_impl.cpp:214:8: error: ‘window’ was not declared in this scope
(void)window;
^~~~~~
libraries/imgui/imgui_impl.cpp:214:8: note: suggested alternative:
In file included from libraries/imgui/imgui_impl.cpp:11:0:
./modules/window/Window.h:35:11: note: ‘love::window’
namespace window
^~~~~~
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
- EntranceJew
- Prole
- Posts: 31
- Joined: Fri Apr 03, 2015 10:02 pm
- Location: Saint Petersburg, Florida
- Contact:
Re: ImGui löve module
In my opinion, the way to handle the generous amounts of globals and enums would be to simply pass a table of strings in their place. Instead of:
It would make sense to:
Code: Select all
imgui.Begin("Another Window", true, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMenu);
Code: Select all
imgui.Begin("Another Window", true, { "AlwaysAutoResize", "NoMenu"} );
Who is online
Users browsing this forum: No registered users and 1 guest