I use my own QGraphicsItem-based class for drawing in QGraphicsScene. I also use FTGL for text rendering. Everything works fine until I start using shaders. My frame update logic is following: in MyGraphicsItem::paint I first update frame with following code (for YUV images):
glEnable(GL_MULTISAMPLE);
QGLFunctions glFuncs(QGLContext::currentContext());
glFuncs.glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_RECTANGLE, tex0Id);
glTexSubImage2D(GL_TEXTURE_RECTANGLE, 0, 0, 0, width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE, data);
glFuncs.glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_RECTANGLE, tex1Id);
glTexSubImage2D(GL_TEXTURE_RECTANGLE, 0, 0, 0, width/2, height/2, GL_LUMINANCE, GL_UNSIGNED_BYTE, data + (width * height));
glFuncs.glActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_RECTANGLE, tex2Id);
glTexSubImage2D(GL_TEXTURE_RECTANGLE, 0, 0, 0, width/2, height/2, GL_LUMINANCE, GL_UNSIGNED_BYTE, data + (int)(5 * width * height) / 4);
shader->bind(width, height);
and after that I render text:
glDisable(GL_TEXTURE_RECTANGLE);
glOrtho(0, WIDTH, 0, HEIGHT, 0, 1);
glColor3f(0.0, 1.0, 0.0);
bufferFont.Render("This is a text", -1, FTPoint(150, 200, -1.0));
But instead of text there is a rectangle. I tried to disable GL_TEXTURE_2D, but it didn't work. How can I use both shaders and FTGL