slages / love-imgui

imgui module for the LÖVE game engine
MIT License
318 stars 61 forks source link

Fix getting window size #46

Open rivten opened 1 year ago

rivten commented 1 year ago

At least for me (LOVE 11.4, LuaJIT 2.1.0-beta3), the basic repo does not work as is. If I take the sample code, there is no imgui window appearing.

Delving with gdb, I figured out that the window width and height at the start of NewFrame were always 0. I have very limited Lua FFI understand, as well as understanding of the stack. But I tried changing the float return to -1 (last value on the stack), and now the code works !

So, here is my PR. I have no idea if this is affecting others.