First of all i want to thank the whole team for their efforts of making the cegui library this fine piece of software it is by now.
Now to my reason for this thread:
Recently i played around with multiple textures and texture coordinates in depth in my renderer and at a point, the cegui opengl renderer threw out solid colored quads, where the interface textures and text should have been.
After several days i figured out the problem. The client texture unit was
set to something, the cegui opengl renderer did not expect it to be.
So before calling the cegui rendering function, make sure to call glClientActiveTexture(GL_TEXTURE0) ( and/or glActiveTexture(GL_TEXTURE0) ... in my case it had no influence).
Anyways here is one possible solution:
Code: Select all
... code taken from OpenGLGUIRenderer - openglrenderer.cpp:
/*************************************************************************
setup states etc
*************************************************************************/
void OpenGLRenderer::initPerFrameStates(void)
{
//save current attributes
glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS);
glPushAttrib(GL_ALL_ATTRIB_BITS);
// NEW SECTION (not sure, if you can just set one of both)
glClientActiveTexture(GL_TEXTURE0);
glClientActiveTextureARB(GL_TEXTURE0);
glActiveTexture(GL_TEXTURE0);
glActiveTextureARB(GL_TEXTURE0);
// END OF NEW SECTION
glPolygonMode(GL_FRONT, GL_FILL);
.....
}
The glClientActiveTexture must be set to GL_TEXTURE0, where the glActiveTexture has no effect. (well, at least in my case)
New entry points have to be defined for the new parameters glClientActiveTexture, glActiveTexture.
I am not very familiar of creating those entry points, but at a quick glance at the glew library, the parameter GL_TEXTURE0 is defined as follows:
#define GL_TEXTURE0 0x84C0
Hope this helps.
hf,
Lucent