Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    [Solved] How to enable the accumulation buffer at QGLWidget?

    General and Desktop
    2
    3
    847
    Loading More Posts
    • 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.
    • K
      koyama last edited by

      Hello,

      I'm trying to use the accumulation buffer in QGLWidget class, and wrote the following code:

      @
      MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
      {
      ui->setupUi(this);

      QGLFormat format = QGLFormat::defaultFormat();
      format.setAccum(true);
      format.setAccumBufferSize(24);
      QGLFormat::setDefaultFormat(format);
      QGLWidget* testWidget = new QGLWidget(this);
      ui->mainLayout->addWidget(testWidget);
      
      assert(testWidget->format().accum());
      

      }
      @

      The problem is, this code always fails at the assertion test. This means the instantiated QGLWidget does not enable the accumulation buffer feature.

      Am I doing something wrong? Any suggestions? Hope someone will help me.

      Qt Creator 3.0.1
      Qt 5.2.1 (Clang 5.0 (Apple), 64 bit)
      MacBook Air (OS X 10.8.5)

      Thank you

      1 Reply Last reply Reply Quote 0
      • M
        mtrch last edited by

        Your code looks fine. Maybe your graphic driver dont support accumulation buffer - it is legacy feature. Some drivers support it for backward compatibility, some not. Your can check supported OpenGL versions, formats and extensions with utilities like "GLView":http://www.realtech-vr.com/glview/

        1 Reply Last reply Reply Quote 0
        • K
          koyama last edited by

          Thank you mtrch, I didn't know that the accumulation buffer has been deprecated. That's why my code doesn't work.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post