fixes #0004103: Black screen when using rubberband selection

This commit is contained in:
wmayer
2019-09-17 15:55:05 +02:00
parent f76e74d2c1
commit f4bc889b4d
4 changed files with 76 additions and 20 deletions

View File

@@ -416,6 +416,13 @@ void SoQtOffscreenRenderer::init(const SbViewportRegion & vpr,
#endif
this->framebuffer = NULL;
this->numSamples = -1;
#if defined(HAVE_QT5_OPENGL)
//this->texFormat = GL_RGBA32F_ARB;
this->texFormat = GL_RGB32F_ARB;
#else
//this->texFormat = GL_RGBA;
this->texFormat = GL_RGB;
#endif
this->cache_context = 0;
this->pbuffer = false;
}
@@ -532,6 +539,18 @@ SoQtOffscreenRenderer::getNumPasses(void) const
return PRIVATE(this)->numSamples;
}
void
SoQtOffscreenRenderer::setInternalTextureFormat(GLenum internalTextureFormat)
{
PRIVATE(this)->texFormat = internalTextureFormat;
}
GLenum
SoQtOffscreenRenderer::internalTextureFormat() const
{
return PRIVATE(this)->texFormat;
}
void
SoQtOffscreenRenderer::setPbufferEnable(SbBool enable)
{
@@ -603,13 +622,7 @@ SoQtOffscreenRenderer::makeFrameBuffer(int width, int height, int samples)
// is to use a certain background color using GL_RGB as texture
// format and in the output image search for the above color and
// replaces it with the color requested by the user.
#if defined(HAVE_QT5_OPENGL)
//fmt.setInternalTextureFormat(GL_RGBA32F_ARB);
fmt.setInternalTextureFormat(GL_RGB32F_ARB);
#else
//fmt.setInternalTextureFormat(GL_RGBA);
fmt.setInternalTextureFormat(GL_RGB);
#endif
fmt.setInternalTextureFormat(this->texFormat);
#else
QtGLFramebufferObject::Attachment fmt;
fmt = QtGLFramebufferObject::Depth;