cimgui-go
cimgui-go copied to clipboard
Autogenerated callbacks
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
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;