QOpenGLWidget stereo rendering using glDrawBuffer



  • Hello,

    i'm trying to draw in the GL_BACK_LEFT and GL_BACK_RIGHT but i get a GL_INVALID_OPERATION just after calling glDrawBuffer.
    It seems that the framebuffer does not support GL_BACK_LEFT and GL_BACK_RIGHT buffers.
    I've set up the QSurfaceFormat like this:

    QSurfaceFormat format = QSurfaceFormat::defaultFormat();
    format.setOption(QSurfaceFormat::StereoBuffers);
    format.setStereo(true);
    QSurfaceFormat::setDefaultFormat(format);**
    

    so that all my QOpenGLWidgets have the same pixel format.
    The stereo is correctly activated because Areo is disabled at launch

    for the rendering (in the painGL method), i simply do a texture draw using the fixed pipeline:

    void draw(int w, int h, float u, float v, int textureId, int buffer)
    {
      glViewport(0, 0, w, h);
      glDrawBuffer(buffer); // Generate the GL_INVALID_OPERATION
      GLenum error = glGetError();
    
      if (error != GL_NO_ERROR)
        std::cout << "GL ERROR: " << error << std::endl;
    
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    
      glEnable(GL_TEXTURE_2D);
      glBindTexture(GL_TEXTURE_2D, textureId);
      glBegin(GL_QUADS);
    
      glTexCoord2f(0, 0);
      glVertex2f(-1, -1);
    
      glTexCoord2f(u, 0);
      glVertex2f(1, -1);
    
      glTexCoord2f(u, v);
      glVertex2f(1, 1);
    
      glTexCoord2f(0, v);
      glVertex2f(-1, 1);
    
      glEnd();
    
      glBindTexture(GL_TEXTURE_2D, 0);
      glDisable(GL_TEXTURE_2D);
    }
    

    Pretty simple.... Is there a known issue with the defaultFramebufferObject when stereo is enabled?

    Sincerelly

    PS: i use Qt 5.4.1 under Windows 8.1



  • Up

    No one?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Sorry I can't help you on that matter, however you can also try the #qt irc channel on freenode


Log in to reply
 

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