OpenGL: CEGUI does not render if a nonzero vertex buffer or program is bound when renderGUI() is called.

Issue #410 resolved
Former user created an issue

Automatic migration. Original reporter: "karwosts"

I had trouble with my CEGUI "hello world" not rendering, until I finally discovered that it was because I had a nonzero target bound to GL_ARRAY_BUFFER (or GL_ELEMENT_ARRAY_BUFFER).

Based on this comment from the wiki (I don't know if it is true or not):

"CEGUI::System::getSingleton().renderGUI() does all the CEGUI magic and sets OpenGL state itself. As long as the viewport is setup, it will render the GUI."

I would believe that I could enter renderGUI with any combination of states set and it would not cause a problem, though it seems not to be the case.

For this to work renderGUI needs to bind the default ARRAY_BUFFER/ELEMENT_ARRAY_BUFFER, during rendering, otherwise a list should be published and clarified that says what state variables need to be set for CEGUI to function properly.

It also appears that it uses any shader program that is bound when the function enters. I would expect it to set the default program for itself if it does not use a shader.

Reproducibility: always

Comments (1)

  1. Martin Preisler

    You are actually somewhat required to "clean" the state for CEGUI. CEGUI has no idea what you have done and reseting everything would be time consuming for users who don't do crazy stuff with OpenGL. You yourself should be the most knowledgeable of what you have done with the state :-)

    Please look into OpenGLRenderer::enableExtraStateSettings

  2. Log in to comment