[Feature Request] Implicit converting between `IntPtr` and `ImTextureID`
It would be nice to have an implicit conversion between IntPtr and ImTextureID to not have to call the constructor where ever the texture is loaded in for certain cases.
I already see there is one for the type ulong but not from IntPtr when looking at https://github.com/HexaEngine/Hexa.NET.ImGui/blob/master/Hexa.NET.ImGui/ImTextureID.cs
Hi, thanks for the suggestion! I’ve added the implicit operators, along with a few additions for void* and nuint. It will be published on NuGet together with #43 once I’m done with that.
It looks like commit e9db85f1 gives me an error related to the implicit conversion change
7>ImGuiD3D11Renderer.cs(531,46): Error CS0457 : Ambiguous user defined conversions 'ImTextureID.implicit operator ImTextureID(ulong)' and 'ImTextureID.implicit operator ImTextureID(nint)' when converting from 'int' to 'ImTextureID'
I rolled back to the commit before that and the project has no problems running
Hi, the c# imgui backends are deprecated anyway, use the native backends from the Hexa.NET.ImGui.Backends package
I pulled down and tried out this package for the first time yesterday and this error was preventing me from using the ExampleD3D11 or ExampleOpenGL3 projects. I'll make a new issue about the example projects not working out-of-the-box.
Passing a literal into anything expecting an ImTextureID will still cause this compiler error for me, though I also can't think of a reason to use a literal.