pkdawson / imgui-godot

Dear ImGui plugin for Godot 4
MIT License
318 stars 18 forks source link

Export project with 4.3 dev6 mono not work #59

Closed neilfranci closed 3 weeks ago

neilfranci commented 1 month ago

Godot 4.2.2 stable worked

Simple scene, nothing much. Example:

ImGui.ShowDemoWindow(); //or ImGui.Begin...

Running from editor fine.

But when exporting to .exe with debug. The console shows this and the game just crashes.

Godot Engine v4.3.dev6.mono.official.89850d553 - https://godotengine.org
Vulkan 1.3.277 - Forward+

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other me.
Repeat 2 times:
--------------------------------
   at ImGuiNET.ImGuiNative.igShowDemoWindow(Byte*)
--------------------------------
   at ImGuiNET.ImGui.ShowDemoWindow()
   at Test._Process(Double)
   at Godot.Node.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name ByRef, Godot.NativeInterop.NativeVariantPtrArgs, Godot)
   at Test.InvokeGodotClassMethod(Godot.NativeInterop.godot_string_name ByRef, Godot.NativeInterop.NativeVariantPtrArgs, Godot.Nativ)
   at Godot.Bridge.CSharpInstanceBridge.Call(IntPtr, Godot.NativeInterop.godot_string_name*, Godot.NativeInterop.godot_variant**, In)
pkdawson commented 1 month ago

That type of crash typically means the plugin wasn't loaded at all.

Thanks for reporting, I'll do some investigation after 4.3-beta1 is released, since I think that's coming soon.

pkdawson commented 1 month ago

I finally had a chance to test this on Windows, and I can reproduce it. Godot 4.3 doesn't put "C#" in the project features list on export. Not sure if that's an intentional change, but regardless there's another way I can detect if C# is enabled for the current project, so I'll get this fixed soon.

pkdawson commented 3 weeks ago

Fixed in v5.1.2