Qt World Summit: Register Today!

QQuickFramebufferObject redraw

  • Hey guys,

    I created a QQuickFramebufferObject to render custom opengl content.
    In QML I placed my component like this:
    Renderer {
    id: renderer
    x: 72
    y: 106
    width: 496
    height: 260
    Renderer is a QQuickFramebufferObject::Renderer class.
    I placed a button on my form to rerender like this:
    button1.onClicked: renderer.update()

    At first start of my application my render-function gets called and it draws as expected.
    When I press the button, my render function get called again by the render-scheduler but this time I don't see anything.

    I reduced my render function to some very simple gl-calls to be sure there is nothing else:
    void NTestFboRenderer::render()
    if (!first) {
    glColor4f(1, 0, 0, 1);
    glVertex2d(0, 0);
    glVertex2d(1, 1);
    first = false;

    Do you have any idea whats wrong here?
    Do I have to mark my fbo as dirty or something?

    glClear works all the time, but when I draw something like vertex I don't see it... (only on first render call)

  • I solved this problem by creating a vertex- and fragment-shader because there was probably another shader active.

    Is there a way to mark this topic as solved?

Log in to reply