OpenGL: problem with setting swap behaviour
-
wrote on 24 Aug 2023, 13:12 last edited by Chris Kawa
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/1