You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like the biggest problem with supporting ImPlot is the fact that it doesn't provide explicitly typed functions, but rather relies on C++ templated parameters, i.e.:
// The templated functions are explicitly instantiated in implot_items.cpp.
// They are not intended to be used generically with custom types. You will get
// a linker error if you try! All functions support the following scalar types:
//
// float, double, ImS8, ImU8, ImS16, ImU16, ImS32, ImU32, ImS64, ImU64
...
#defineIMPLOT_TMPtemplate <typename T> IMPLOT_API
...
IMPLOT_TMP voidPlotLine(constchar* label_id, const T* values, int count, double xscale=1, double xstart=0, ImPlotLineFlags flags=0, int offset=0, int stride=sizeof(T));
sadly with dear_bindings as of now, this generates C bindings which have the const T* values templated parameter in their signature, which fails to compile.
@ZimM-LostPolygon Since you showed interest to get ImPlot working, do you have a plan on tackling this?
cimplot seems to do this by generating a function binding for each explicit type:
Yes... it gets a little complicated with a user-defined type that a definition isn't available for, but a little light parsing and possibly typedef resolution feels like it would be a good way to get a list to work from.
It seems like the biggest problem with supporting ImPlot is the fact that it doesn't provide explicitly typed functions, but rather relies on C++ templated parameters, i.e.:
...
sadly with
dear_bindings
as of now, this generates C bindings which have theconst T* values
templated parameter in their signature, which fails to compile.@ZimM-LostPolygon Since you showed interest to get ImPlot working, do you have a plan on tackling this?
cimplot
seems to do this by generating a function binding for each explicit type:https://github.com/cimgui/cimplot/blob/439f705b1cfae0e9fbe42c13ab5b45becc47d404/generator/generator.lua#L188
and frankly this seems like the easiest solution. Perhaps this can be implemented under modifiers akin to
mod_flatten_templates
? Ideas?The text was updated successfully, but these errors were encountered: