Open gucio321 opened 1 year ago
Yes
Ok, are there any plans to fix this? I'd love to contribute but unfortunately I have absolutely no experience with lua.
It is no fix but enhancement. I can check it but imnodes seems abandoned.
Which is the use of ImNodesContext that you need? With imnodes.h you have the declaration as an opaque type.
We need this structure to be in json file in cimgui-go, because we can't generate wrapper for functions like CreateContext -essential to use the library
As CreateContext is returning a pointer to ImNodesContext (ImNodesContext ) you should not need the detailed structure of ImNodesContext. It could even be defined as a `void `. Whatever is returned by imnodes_CreateContext can be used in imnodes_SetCurrentContext or imnodes_DestroyContext without knowing the specific ImNodesContext structure.
An opaque type is a type which is exposed in APIs via a pointer but never concretely defined.
In typedefs_dict.json you will see "ImGuiContext": "struct ImGuiContext",
which in C is typedef struct ImNodesContext ImNodesContext;
where ImNodesContext is an opaque struct. You cant use ImNodesContext
but you can use ImNodesContext *
yes, but there are three problems:
void*
(which is unsafe.Pointer in go) because... well Go does not have usable integration between go and C for this type :smile:It'd be the best solution for us (if possible) to implement solution already present in cimgui - add cimnodes_internal to generator
If you know any GLFW wrapping in go, you could look how is handled in:
GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
https://www.glfw.org/docs/3.3/window_guide.html#window_object
https://github.com/go-gl/glfw is one of them.
Well, i Knorr about this method am theoretically i could do it this way, but (as mentioned above) handling pointers is not the reason why i need nodesContext in structs_and_enums.json We also need to generate setters/getters for fields of this structure so that our users could obtain some days about this context.
generate setters/getters for fields of this structure
When a structure is opaque it is usually for avoiding this. Which fields would be interesting to get/set and what for?
When a structure is opaque it is usually for avoiding this.
I see. However cimgui allows generating these types when internal
specified...
What we need is a compatibility between cimgui and other wrappers because so that our generator could work as expected.
Also I can't say which exactly field of ImNodesContext our users may need, however because of GO's types privacy, they wouldn't be able to access these fields anyhow (when they theoritically could if they used C++ code by #include "imnodes_internal.h"
)
after a quick look at code I suppose that
imnodes_internal.h
support is missing