Enable the depth and stencil buffers by default in QOpenGLWidget
QGLWidget rendered to the default framebuffer, which had a depth and stencil buffer attached by default. Keep this behavior by adding the attachments to the FBO by default in QOpenGLWidget. Change-Id: I6f72a444eac3d8eabb7a539ad12216f1e5d2183d Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
This commit is contained in:
parent
ee3dea8d3f
commit
7672f25f44
@ -163,7 +163,7 @@ void QOpenGLWidget::resizeEvent(QResizeEvent *)
|
||||
|
||||
d->context.makeCurrent(d->surface());
|
||||
delete d->fbo; // recreate when resized
|
||||
d->fbo = new QOpenGLFramebufferObject(size() * devicePixelRatio());
|
||||
d->fbo = new QOpenGLFramebufferObject(size() * devicePixelRatio(), QOpenGLFramebufferObject::CombinedDepthStencil);
|
||||
d->fbo->bind();
|
||||
QOpenGLFunctions *funcs = d->context.functions();
|
||||
funcs->glBindTexture(GL_TEXTURE_2D, d->fbo->texture());
|
||||
|
Loading…
x
Reference in New Issue
Block a user