0x0ade / ImGuiCS

Heavily modified fork of ImGui.NET + SDL2-CS, XNA and FNA samples
MIT License
7 stars 0 forks source link

ImGuiCS core discussion #4

Open 0x0ade opened 7 years ago

0x0ade commented 7 years ago

Feel free to discuss anything regarding ImGuiCS (the ImGui.NET fork) itself here.

fxgenstudio commented 6 years ago

I need "ImGuiColorTextEdit" component, I think I already have my answer but do you have a tool to help C++ to C# conversion ?

https://github.com/BalazsJako/ImGuiColorTextEdit

0x0ade commented 6 years ago

Unfortunately no. I've attempted something similar by converting imguifilesystem with the replace function step by step and then fixing it by hand, but never finished fixing it completely.

I wish C# had an easy way to interop with C++ libraries, as it'd make using existing ImGui components so much easier.

fxgenstudio commented 6 years ago

Could you update ImguiCS to last Imgui 1.54 ? Thanks.

0x0ade commented 6 years ago

I'll try to do it this week, but no promises as I'll also have an exam this week.

fxgenstudio commented 6 years ago

How to do C++ ImGui::GetWindowDrawList()->AddImage(...) in CS ?

0x0ade commented 6 years ago

I've just added the missing AddImage binding to ImDrawList and moved a method to match its native counterpart: https://github.com/0x0ade/ImGuiCS/commit/39e0fc50473fe8c2358b4b175005de5503db4f7b, https://github.com/0x0ade/ImGuiCS/commit/e8d3930d7155af0ab8c8692afb403d047ccedf61

ImGui::GetWindowDrawList()->AddImage(...)

becomes

ImGui.GetWindowDrawList().AddImage(...)

In XNA and FNA, you need to register your texture to the ImGuiXNAState. The Register method returns the ID you need to use.

Note that I haven't had time to test this yet. Please tell me if this does or doesn't work.

fxgenstudio commented 6 years ago

Thanks that work ! I display texture font.

image

0x0ade commented 6 years ago

@procfxgen I'll attempt to update the bindings to 1.54 after cimgui 1.54 drops, which should happen shortly after ImGUI 1.54 itself gets released.

Please note that I can only build cimgui 1.54 for Windows x64 and Linux x64. We'll need to wait until someone builds cimgui 1.54 binaries for macOS x64 and all x86 variants.

zeaga commented 6 years ago

Is there any way I can hide the close button of a window?

Related: https://github.com/ocornut/imgui/issues/1305

0x0ade commented 6 years ago

@zeaga It should be possible by doing this:

bool opened = false;
ImGui.Begin("Window Title", ref opened /*, ...*/);

Please tell me if this works or not, I currently can't test it.

zeaga commented 6 years ago

Nope, didn't work unfortunately.

0x0ade commented 6 years ago

ImGUI 1.60 has finally been released: https://twitter.com/ocornut/status/982759513672634374

Unfortunately I'm busy with other projects right now, which means that I'm (hopefully) going to update ImGuiCS later this month.

fxgenstudio commented 6 years ago

Perfect !

0x0ade commented 6 years ago

The underlying C binding - cimgui - hasn't been updated to ImGui 1.60 just yet: https://github.com/Extrawurst/cimgui/issues/49

ImGuiCS and ImGui.NET rely on cimgui, as C# can't natively (without using helpers) interop with C++ in a cross-platform manner.

I'll update ImGuiCS after cimgui's master branch supports 1.60.