drawText on opengl image


I display live video using OpenGl. So, I do YUV=>RGB transform on GPU and display it, using shaders. Evrything works fine until I want to draw some text on the video (like fps or smth).
I’ve looked at QT example opengl/overpainting. But it does’t work in my case. It seems like drawText/renderText uses the same mechanisms to draw text as I use to draw video.
So as the result I do not see text at all. But at the same time I can draw lines on the video and smth like that… I’m not very good ( not good at all in GL). So can you please help me.

Here is minimized code( it is still big, sorry for that)…



I think that my shaders some how corrilates( broke ) with renderText.

What about disable GLSL programs before draw text,

then reenable after ?

Thank you for replay!

glUseProgram(0) does not help.
Am I doing smth wrong?

At very begining I did

glUseProgram = (_glUseProgram) QGLContext::currentContext()->getProcAddress(QLatin1String("glUseProgram")); 

after that befor draw text I call glUseProgram(0);
But text still not visible.

Even more than that…

I call glUseProgram(0) right after

glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_program[prog]);

The video is still fine so, sharders works in spite of glUseProgram(0). And glGetError after glUseProgram(0) returns 0.

From other hand if I do not call glDisable(GL_FRAGMENT_PROGRAM_ARB) after I finished draw frame I can see the text but it’s not very well displayed …

Problem is solved by adding glPushAttrib(GL_ALL_ATTRIB_BITS);
and glPopAttrib();