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. OpenGL: problem with setting swap behaviour
Forum Updated to NodeBB v4.3 + New Features

OpenGL: problem with setting swap behaviour

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 115 Views
  • 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
    KR51
    wrote on 24 Aug 2023, 13:12 last edited by Chris Kawa
    #1

    Hi,

    I'm facing a problem with OpenGL and setting the swap behaviour. This is part of the code (Qt 5.15, running on raspberry pi 4):

        QSurfaceFormat format;
        format.setDepthBufferSize( 16 );
        format.setStencilBufferSize( 8 );
    
        format.setSwapBehavior( QSurfaceFormat::DoubleBuffer );
        setFormat( format );
    
        qWarning() << "format: " << format.swapBehavior();
        m_context = new QOpenGLContext;
    
        m_context->setFormat(format);
        m_context->create();
    
        if (!m_context->isValid())
            qWarning() << "Context not valid!!!";
    
        qWarning() << "m_context: " << m_context->format().swapBehavior();
    

    This is what I get as result from my console:

    format:  QSurfaceFormat::DoubleBuffer
    m_context:  QSurfaceFormat::DefaultSwapBehavior
    

    I don't understand why the swapBehavior is set back to from DoubleBuffer to DefaultSwapBehavior.

    Do you have any ideas?
    Thanks and best regards

    1 Reply Last reply
    0

    1/1

    24 Aug 2023, 13:12

    • Login

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