Updated ImGui binding for cocos2d-x

Is there any?

I’ve spent quite some time searching and trying and I found these:



First two are completely outdated and not working on my desired development platform (Linux), however the middle one does work on Windows (that doesn’t help me).

The third one only allows imgui calls to be placed in one specific code section, so it really doesn’t do what I want.

I’ve also found (and google-translated) some blog in Chinese where the author supposedly made it work for cocos2d-x 3.16 and even kindly provided a link to his repaired version, but said link is to a Chinese file hosting portal I have no way to access. Here’s a link to the blog:

I’ve even tried to fix them on my own after reading the official ImGui documentation on bindings, but it looks like that kind of thing is way beyond my skill right now.

Anyone know if any up-to-date binding currently exists and where can I find it?

Or maybe someone here is able to access this Chinese hosting site and could re-upload that solution somewhere accessible?

I can’t access the baidu link either. I have asked one of my co-workers to assist in getting it downloaded for us.

Here is the version you requested: https://www.icloud.com/iclouddrive/0g3ED224gezOUVPmw1WeE8z5w#imgui1.6%2Bcocos2dx3.16

1 Like

Thanks for re-uploading.

I’ve managed to integrate it into my project, since it’s on Linux, I used the imgui_impl_glfw_mac.cpp, but looks like it’s not going to help me.

Here’s how my scene looks like with imgui windows displayed:

Looks like they are stretched over the entire screen and most likely I’m not going to be able to debug and fix it without intricate knowledge of OpenGL rendering pipeline ;(

This bug doesn’t happen on plain Hello World example.

One sure way to reproduce it is to display imgui together with a visible (not fully transparent) cocos2d::ui::Layout widget (or a Panel widget loaded from cocosstudio).

Update:

I’ve managed to migrate the binding to OpenGL 3 and the problem seems to be gone, if anyone’s interested I’ve provided a project demo here:

Just want to jump in and say that I was able to use that https://github.com/c0i/imguix for a test project, with cocos2dx-3.14 or so. I must have had to make some tweaks, but it was working just fine.

Glad you got things sorted out!

@M4713

I refer to your code to upgrade https://github.com/c0i/imguix .

now imguix with cocos2d-x-cpp 3.17.1 and ImGui 1.7 .

1 Like