cocos2d-x with imgui

Hi all,

I’m writing a demo , imguix. It shows how ImGui works with cocos2d-x.

https://github.com/c0i/imguix/raw/master/imguix.png

One embedded “editor” in cocos2d-x:

https://cloud.githubusercontent.com/assets/5056328/11366275/2f01e254-92e7-11e5-9854-587a409e1e68.png

It’s very easy to get ImGui works with cocos2d-x on OS X, thanks to ImGui portable.

But, i got some problem on windows, here is some information:

  1. ran cocos2d-x game normally, means the OpenGL driver is ok.

  2. call CHECK_GL_ERROR_DEBUG() after ImGui::Render();

    #define CHECK_GL_ERROR_DEBUG() \
        do { \
            GLenum __error = glGetError(); \
            if(__error) { \
                cocos2d::log("OpenGL error 0x%04X in %s %s %d\n", __error, __FILE__, __FUNCTION__, __LINE__); \
            } \
        } while (false)
    
  3. got OpenGL error 0x0501 when hide the game window:

    Ready for GLSL
    Ready for OpenGL 2.0
    OpenGL error 0x0501 in classes\helloworldscene.cpp HelloWorld::onDraw 101
    
    OpenGL error 0x0501 in classes\helloworldscene.cpp HelloWorld::onDraw 101
    

https://cloud.githubusercontent.com/assets/170314/11267473/8b1f5bb6-8ee6-11e5-80f3-a48672d42c9f.png

The project is here : https://github.com/c0i/imguix.
Would anyone help me to solve this problem ?

Any pull request is welcome.
Thanks.

2 Likes

@yinjimmy
Hey continuing the correspondence from github ,
im working on this also now .
please check this cocos2d-x thread talking about integrating other openGL GUI

sovled,sovled,sovled

https://cloud.githubusercontent.com/assets/5056328/11398441/a5b30782-93bb-11e5-91ab-c90b30250c90.png

Good job!
can you share what you did ?

Using the programmable pipeline instead of fixed pipeline, ref to iOS example in ImGui.
I’ll update the https://github.com/c0i/imguix tomorrow.

1 Like

Wow guys good work, I normally use ionicframewok with cordova for my applications. Maybe I can try creating an application with this.

Thanks, hope it useful for you.

2 Likes

My new game editor screenshot. It mimics Unity editor.

1 Like

Great stuff , did you open source it ?

Not yet so far. I am thinking about the open source but it will take times.