Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. The OpenGL pbuffer example appearing blank

The OpenGL pbuffer example appearing blank

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 697 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RamK
    wrote on last edited by
    #1

    I am using Qt 5 cloned from git and build using command,
    "configure -developer-build -opensource -nomake tests -nomake examples -opengl desktop -mp"
    When I tried running opengl examples which come with Qt source e.g. pbuffer , its getting blank screen.
    Then i tried checking the openGL version, i have openGL version 3.3.

    I added logs and tried setting version to QGLFormat in glwidget.cpp
    @GLWidget::GLWidget(QWidget *parent)
    : QGLWidget(QGLFormat(QGL::SampleBuffers), parent)
    , geom(0)
    , cube(0)
    {
    // create the pbuffer
    QGLFormat pbufferFormat = format();
    pbufferFormat.setVersion(3,3); // added by me
    QGLFormat::setDefaultFormat(pbufferFormat); // added by me

    pbufferFormat.setSampleBuffers(false);
    pbuffer = new QGLPixelBuffer(QSize(512, 512), pbufferFormat, this);
    setWindowTitle(tr("OpenGL pbuffers"));
    initializeGeometry();
    

    }

    void GLWidget::paintGL()
    {
    pbuffer->makeCurrent();
    drawPbuffer();

    // added by me
    QString openGLversion((char *)glGetString(GL_VERSION));
    qDebug()<<"OpenGL version::" << openGLversion;
    qDebug()<<"\nOpenGL format verions:: " << QGLFormat::openGLVersionFlags();
    qDebug()<<"\nOpenGL context::" << this->format();
    ...
    }
    @log output:

    OpenGL version:: "3.3.0"

    OpenGL format verions:: QFlags(0x1|0x2|0x4|0x8|0x10|0x20|0x40|0x1000|0x2000|0x4000|0x8000)

    OpenGL context:: QGLFormat(options QFlags(0x1|0x2|0x4|0x8|0x20|0x80|0x200|0x400) , plane 0 , depthBufferSize 24 , accumBufferSize -1 , stencilBufferSize 8 , redBufferSize 8 , greenBufferSize 8 , blueBufferSize 8 , alphaBufferSize 8 , samples 4 , swapInterval -1 , majorVersion 3 , minorVersion 3 , profile 0 )

    With this change of setting version I still observed blank screen , however if I make any version set below 3.2 I can see the proper output on screen :)
    @ pbufferFormat.setVersion(3,1); // i tried with 1.0 / 2.1/ 3.0@
    but in the logs still it gives output as "OpenGL version:: "3.3.0" "

    can anyone please explain what is the issue here and why defaults qt examples from qt git src are behaving like this.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved