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. [Solved] How to enable the accumulation buffer at QGLWidget?
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 990 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.
  • K Offline
    K Offline
    koyama
    wrote on last edited by
    #1

    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
    0
    • M Offline
      M Offline
      mtrch
      wrote on last edited by
      #2

      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
      0
      • K Offline
        K Offline
        koyama
        wrote on last edited by
        #3

        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
        0

        • Login

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