I'm working on a Qt 5.15 OpenGL application running on my raspberry 4B with Raspian. I'm using a library for plotting realtime waveform that works perfectly on different machines/OS like windows or Linux. I tried to find the part in the code that could be the reason for this and found this: I want to set the QOpenGLContext to use DoubleBuffer:
QSurfaceFormat format;
format.setDepthBufferSize( 24 );
format.setStencilBufferSize( 8 );
format.setProfile(QSurfaceFormat::NoProfile);
format.setVersion(3,1);
format.setRedBufferSize(8);
format.setGreenBufferSize(8);
format.setBlueBufferSize(8);
format.setAlphaBufferSize(8);
format.setSwapBehavior( QSurfaceFormat::DoubleBuffer );
setFormat( format );
m_context = new QOpenGLContext;
m_context->setFormat(format);
qWarning() << m_context->format();
m_context->create();
qWarning() << m_context->format();
And this is what I see on my console:
QSurfaceFormat(
version 3.1,
options QFlags<QSurfaceFormat::FormatOption>(),
depthBufferSize 24,
redBufferSize 8,
greenBufferSize 8,
blueBufferSize 8,
alphaBufferSize 8,
stencilBufferSize 8,
samples -1,
swapBehavior QSurfaceFormat::DoubleBuffer,
swapInterval 1,
colorSpace QSurfaceFormat::DefaultColorSpace,
profile QSurfaceFormat::NoProfile
)
QSurfaceFormat(
version 3.1,
options QFlags<QSurfaceFormat::FormatOption>(),
depthBufferSize 24,
redBufferSize 8,
greenBufferSize 8,
blueBufferSize 8,
alphaBufferSize 8,
stencilBufferSize 8,
samples 0,
swapBehavior QSurfaceFormat::DefaultSwapBehavior,
swapInterval 1,
colorSpace QSurfaceFormat::DefaultColorSpace,
profile QSurfaceFormat::NoProfile
)
As you can see the swapBehaviour switches from DoubleBuffer to DefaultSwapBahvior, but I don't see any reason why or how to avoid this - to you have any idea? Thanks and best regards!!!