[SOLVED] Overpainting with OpenGL 3.1 (with array buffers)



  • Hi. I'm trying to use QPainter for overpainting purposes in a renderer that is based on QGLWidget with 3.1 OpenGL version. I use CG shaders and index buffers. Every time I turn the rendering off, QPainter works. But when I try to render something, it doesn't. Just no showing anything at all, only resetting the veiwport. Already tried rendering inside of QPainter::beginNativeRendering, but to no avail. Is there some kind of a trick I should use? Or is it a dead cause?

    Edit: QT 4.7.1. on XWindow system

    Edit: I've noticed that glBindBuffer is the culprit. After the call to it, QPainter doesn't paint a thing. Is there any way to fix it? Every example strangely uses only primitive gl functions, but tells nothing about advanced techniques such as drawing from buffers.

    Solution: Before the call to QPainter::begin(); It is essential to call glBindBuffer(/buffer type/, 0); to unbind all the buffers.



  • Solved. Solution: Before the call to QPainter::begin(); It is essential to call glBindBuffer(/buffer type/, 0); to unbind all the buffers.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.