Better_Software_Header_MobileBetter_Software_Header_Web

Find what you need - explore our website and developer resources

OpenGL in Qt 5.1 – Part 4


void Scene::initialize()
{
    m_logger = new QOpenGLDebugLogger( this );

    connect( m_logger, SIGNAL( messageLogged( QOpenGLDebugMessage ) ),
             this, SLOT( onMessageLogged( QOpenGLDebugMessage ) ),
             Qt::DirectConnection );

    if ( m_logger->initialize() ) {
        m_logger->startLogging( QOpenGLDebugLogger::SynchronousLogging );
        m_logger->enableMessages();
    }

    // Populate a buffer object
    m_positionBuffer.create();
    m_positionBuffer.setUsagePattern( QOpenGLBuffer::StreamDraw );
    m_positionBuffer.bind();
    m_positionBuffer.allocate( positionData,
                               vertexCount * 3 * sizeof( float ) );
}

void Scene::onMessageLogged( QOpenGLDebugMessage message )
{
    qDebug() << message;
}

QOpenGLDebugMessage("APISource", 131185, "Buffer detailed info: Buffer object 1 (bound to GL_ARRAY_BUFFER_ARB, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.", "LowSeverity", "OtherType")

About KDAB


6 Comments

31 - Jul - 2013

Sky

29 - Oct - 2013

Jelko

5 - Sept - 2014

programmer

28 - Aug - 2015

delphine

30 - Aug - 2015

Sean Harmer

31 - Aug - 2015

delphine

SeanHarmer

Sean Harmer

Managing Director KDAB UK