cimgui-go icon indicating copy to clipboard operation
cimgui-go copied to clipboard

Autogenerated callbacks

Open gucio321 opened this issue 2 years ago • 1 comments

Things like InputTextCallback should be autogenerated. I have an idea how to do this

  • declare go callback type
  • if C function needs callback, take go callback and convert it to uintptr via cgo.handle
  • in c declare a local function (in the function that wants to pass callback to c++) and make it compatible with our destination type
  • in go were should also have an exported to c function that takes uintptr (and other necessary parameters of needed). This one should just decide uintptr back to go type and call it
  • local c function mentioned above calf go exported function

This workflow should allow us to autogenerate callbacks

gucio321 avatar Sep 25 '23 20:09 gucio321

This is not possible as C doesn't support so called "deltas"

I have another Idea. I need set of "global variables" (yeah I know its awful but its C).

type Callback1;
bool Callback1_used;

gucio321 avatar Feb 20 '24 20:02 gucio321