psydack/uimgui

[QUESTION] Mac and Linux support

Opened this issue ยท 18 comments

I really like this project i just wanted to know

Is there any way to make this work for linux and mac?

A second question can i use this on a commercial project?

@psydack, is there any plan to add support for those?

would highly appreciate support for linux and mac here

Sorry about late response.

I'm working in this branch https://github.com/psydack/uimgui/tree/feature/multiplatform to support linux and mac.

Also, you're free to use on commercial project since you're sharing this LICENSE.txt from original ImGUI project

Hi @psydack what is the current status on linux?
Thanks

Hi @psydack,
any chance for a hint about at what features might be missing?
I'm planning to increase ImGui usage but will have to support Mac down the road - so it would be great to know features to skip in advance.
Thanks a lot

Actually I took multiplatform branch, merged with master and it works on linux.
https://github.com/ceccocats/uimgui

Check this branch:

https://github.com/psydack/uimgui/tree/update-2024-q1

It's missing

  • FreeType
  • ImNodes
  • ImGuizmo
  • ImPlot

But everything else works like a charm

That looks great - I'll give it a try on a Mac later this month.
Thanks

Hello!

Trying out the branch, it looks like ImGuiNET is missing as a macOS dependency (error CS0246: The type or namespace name 'ImGuiNET' could not be found (are you missing a using directive or an assembly reference?)).

Looking forward to seeing this working, and please let me know if there's any additional information I can provide!

Would you check if this branch is working? 41-question-mac-and-linux-support

git fetch origin
git checkout 41-question-mac-and-linux-support

I have two errors with 41-question-mac-and-linux-support

FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
UImGui.UIOConfig.ApplyTo (ImGuiNET.ImGuiIOPtr io) (at /Users/vincentborcard/Documents/GitHub/uimgui/Source/Data/UIOConfig.cs:86)
UImGui.UImGui.OnEnable () (at /Users/vincentborcard/Documents/GitHub/uimgui/Source/UImGui.cs:170)

and

NullReferenceException: Object reference not set to an instance of an object
UImGui.Texture.TextureManager.RegisterTexture (UnityEngine.Texture texture) (at /Users/vincentborcard/Documents/GitHub/uimgui/Source/Texture/TextureManager.cs:98)
UImGui.Texture.TextureManager.PrepareFrame (ImGuiNET.ImGuiIOPtr io) (at /Users/vincentborcard/Documents/GitHub/uimgui/Source/Texture/TextureManager.cs:66)
UImGui.UImGui.DoUpdate (UnityEngine.Rendering.CommandBuffer buffer) (at /Users/vincentborcard/Documents/GitHub/uimgui/Source/UImGui.cs:254)
UImGui.UImGui.Update () (at /Users/vincentborcard/Documents/GitHub/uimgui/Source/UImGui.cs:245)

@vincent-borcard-strangers have you found a fix or workaround for those errors?

Anyone had success with this branch on macos?

@vincent-borcard-strangers @tenpn
I recently had access to a Mac for a short time and had another look at the issue and what's causing the problem seems to be that the settings for the plugin dll limit it to Intel CPUs, and in my case, the Mac had an Apple CPU.
Locate the System.Runtime.CompilerServices.Unsafe.dll, select it and, in the Inspector, change the platform settings for the editor from Intel 64-bit to Any CPU.
In my case, I added the UImGui as sources into the Assets folder so the exact path was
Assets/uimgui/plugins/System.Runtime.CompilerServices.Unsafe.dll

I had the 3 optional additions disabled using the known defines (UIMGUI_REMOVE_*).

I haven't done any real tests as I only had access to the Mac for a few hours, so there might be other issues down the road. A quick, initial test with a debug popup menu, worked as expected.

I made progress by using the Mac-and-linux-support branch, changing the DLL as above, and adding the REMOVE defines. However when I enter play mode, I get an OS popup saying "cimgyu.dylib cannot be opened because the developer cannot be verified". This gives me the option to Move To Bin or Cancel. If I Cancel, I get more identical dialogues. If I hammer cancel on all, I get into the game but there's exceptions in ImGUI because it can't find cimgui.

@tenpn did you use UImGui as sources (iirc we use the branch psydack has linked in a previous reply?
Sadly I don't have any other idea as I don't own a Mac and I'm kind of new to Unity (working on my first project) and am not an active Mac user, I only have access every once in a while for a few hours :/

Thanks for the help @Nelvin @tenpn, I got this working on my Apple Silicon Macbook with Unity 6. To summarize:

  1. Add the package via git at https://github.com/psydack/uimgui.git#41-question-mac-and-linux-support
  2. Change the platform settings for Plugins/System.Runtime.CompilerServices.Unsafe.dll to not be Intel specific. Rather than import the whole plugin into your Assets folder, you can just edit the meta file at Library/PackageCache/com.psydack.uimgui/Plugins/System.Runtime.CompilerServices.Unsafe.dll.meta and change from CPU: x86_64 to CPU: AnyCPU.
    I opened a PR for this: #73
  3. Add the following Defines in Project Settings > Player > Other Settings > Scripting Define Symbols: UIMGUI_REMOVE_IMPLOT, UIMGUI_REMOVE_IMNODES, UIMGUI_REMOVE_IMGUIZMO, since these features are not supported as noted here: #41 (comment)

If you're trying this with Unity 6 and URP, you'll also need to do the steps I outlined here: #14 (comment)