apicici / cimgui-love

LÖVE module for Dear ImGui obtained by wrapping cimgui with LuaJIT FFI.
MIT License
76 stars 6 forks source link

90% of functions are broken or un documented #15

Closed JakeyWasTaken closed 1 year ago

JakeyWasTaken commented 1 year ago

90% of functions are broken or there is no documentation on how to use them, not to mention that the error messages are useless.

For example: "Cannot convert number to 'float *'" what kind of error is that, a number is a float in lua

imgui.ColorPicker4("Color", 1.0,1.0,1.0)
apicici commented 1 year ago

With the exception of the LÖVE rendering and input functions, cimgui-love is simply an FFI wrapper for cimgui/Dear ImGui. For documentation on how to use the function you will have to refer to the Dear ImGui documentation (in the file imgui.h).

Regarding those error messages: the function calls are not just Lua functions, as they use FFI to call the C functions directly. When possible the Lua objects are converted to cdata automatically, but in your exemple the function is expecting a cdata representing a pointer to a float, which you will need to create yourself using FFI. You cannot just convert a number to a pointer, which is what the error message is helpfully telling you.

As mentioned in the README, you need some familiarity with LuaJIT FFI to use cimgui-love (which in turn means you need some familiarity with C).

JakeyWasTaken commented 1 year ago

Yeah I apologise for not reading through the read me more clearly, my mistake. thanks for clearing up the documentation