문제

I am learning the basics of OpenGL with Qt and it seems sample buffers are Qt specific, and I don’t really understand what information they store for the screen. What is a Sample Buffer and what is it used for?

도움이 되었습니까?

해결책

They are used to get multisampling in Qt. Setting up multisampling is normally platform specific (since it requires a pixel format with multisampling support), but Qt lets you do this in a platform independent way. To get a OpenGL context with multisampling you pass a QGLFormat with sample buffers enabled when creating your QGLWidget.

Specifically, QGLFormat::setSampleBuffers is used to request a multisampled context and QGLFormat::setSamples is used to set the prefered number of samples.

In your OpenGL code you also have to enable multisampling before rendering:

glEnable(GL_MULTISAMPLE);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top