So I'm trying to use this plugin on my Rust backend with gdext, I can call GetImGuiPtrs perfectly fine,
but when it comes to setting the current imgui context with the pointer returned by that function, it seems that the pointer is actually invalid, it's just pointing to a garbage memory, and when I try to destroy it (just to figure out if it's actually ImGuiContext* or not), the whole app just crashes.
Here's the code that I wrote.
let obj = ClassDb::singleton().instantiate("ImGuiSync");
unsafe {
let ptrs: PackedInt64Array = obj.call("GetImGuiPtrs", &[
Variant::from(CStr::from_ptr(ImGui::GetVersion()).to_str().unwrap()),
Variant::from(size_of::<ImGuiIO>() as i32),
Variant::from(size_of::<ImDrawVert>() as i32),
Variant::from(size_of::<ImDrawIdx>() as i32),
Variant::from(size_of::<ImWchar>() as i32),
]).to();
ImGui::DestroyContext(transmute(ptrs[0]));
}
I use this example , this, and this for reference
So I assume that I need to call GetImGuiPtrs
Hey,
So I'm trying to use this plugin on my Rust backend with gdext, I can call
GetImGuiPtrs
perfectly fine, but when it comes to setting the current imgui context with the pointer returned by that function, it seems that the pointer is actually invalid, it's just pointing to a garbage memory, and when I try to destroy it (just to figure out if it's actuallyImGuiContext*
or not), the whole app just crashes.Here's the code that I wrote.
I use this example , this, and this for reference So I assume that I need to call
GetImGuiPtrs